need information on the following items

Discussion in 'C Programming' started by Rajnee Kanth, Jan 3, 2006.

  1. Rajnee Kanth

    Rajnee Kanth Guest

    Hi,

    I want some info on the following items....send me what ever info u
    have pls.....

    1) Segmentaion Voilation

    2) Shared Objects files

    3) Virtual Functions

    4) How can I call a c function in a c++ program and vice versa?

    5) what is the default size of a stack and heap ?

    6) Signalling in UNIX

    Pls do the needful. Thank you.
     
    Rajnee Kanth, Jan 3, 2006
    #1
    1. Advertising

  2. Rajnee Kanth

    pemo Guest

    "Rajnee Kanth" <> wrote in message
    news:...
    > Hi,
    >
    > I want some info on the following items....send me what ever info u
    > have pls.....
    >
    > 1) Segmentaion Voilation
    >
    > 2) Shared Objects files
    >
    > 3) Virtual Functions
    >
    > 4) How can I call a c function in a c++ program and vice versa?
    >
    > 5) what is the default size of a stack and heap ?
    >
    > 6) Signalling in UNIX
    >
    > Pls do the needful. Thank you.


    3/4 - go and ask on comp.lang.c++

    5 - C knows nothing about such things

    6 - ask on a Unix group

    2 - what do you mean?

    1 - you accesses memory you didn't own
     
    pemo, Jan 3, 2006
    #2
    1. Advertising

  3. Rajnee Kanth

    Eric Sosman Guest

    Rajnee Kanth wrote:
    > Hi,
    >
    > I want some info on the following items....send me what ever info u
    > have pls.....
    >
    > 1) Segmentaion Voilation


    Never heard of it. I've been writing programs (and
    bugs) for forty years, and this is the first mention of
    "Segmentaion" or of "Voilation" I've seen. This must be
    some kind of new technology you should ask your professor
    about; I'm too far behind the times to help you.

    > 2) Shared Objects files


    No such thing. C objects are memory-resident; data in
    a file does not qualify as an object.

    > 3) Virtual Functions


    You've misspelled "virtuous." A virtuous function is one
    that has no side-effects; these are also called "pure" functions.

    > 4) How can I call a c function in a c++ program and vice versa?


    Not possible, in either direction. All functions in
    a C program are C, so there are no C++ functions to call.
    Similarly, a C++ program contains only C++ functions (some
    may look a lot like C, but if they reside in a C++ program
    the C++ rules prevail).

    > 5) what is the default size of a stack and heap ?


    Stack: twenty-three plates, two with chips on the rims.
    Heap: 2.2 cubic yards of rapidly hardening concrete.

    > 6) Signalling in UNIX


    UNIX is off-topic here. Try alt.lang.cobol.

    > Pls do the needful.


    I've tried to follow your example, doing as much of the
    needful as you seem to have done.

    > Thank you.


    You're more than welcome -- but only once. Now, please
    go away.

    --
    Eric Sosman
    lid
     
    Eric Sosman, Jan 3, 2006
    #3
  4. Eric Sosman <> wrote:

    > You've misspelled "virtuous." A virtuous function is one
    > that has no side-effects; these are also called "pure" functions.


    I thought a "virtuous" function was one that behaved the way the
    programmer intended. :)

    --
    Christopher Benson-Manica | I *should* know what I'm talking about - if I
    ataru(at)cyberspace.org | don't, I need to know. Flames welcome.
     
    Christopher Benson-Manica, Jan 3, 2006
    #4
  5. Rajnee Kanth

    pemo Guest

    "Christopher Benson-Manica" <> wrote in message
    news:dpdut0$br3$...
    > Eric Sosman <> wrote:
    >
    >> You've misspelled "virtuous." A virtuous function is one
    >> that has no side-effects; these are also called "pure" functions.

    >
    > I thought a "virtuous" function was one that behaved the way the
    > programmer intended. :)


    No, that's a 'lucky one'!
     
    pemo, Jan 3, 2006
    #5
  6. Rajnee Kanth

    Alastair Guest

    I may have some "helpful" information with regard to Virtual functions
    - however looking at the replies that you have got I am not sure that
    this is the correct term:

    I use the term "Virtual" function on C to mean a function pointer.

    For example if we declare a virtual function (function pointer named
    fnc_ptr) like this:
    void (*fnc_ptr) (void);

    Then later we can make this function pointer point to a real function
    (i.e. the address of the function in memory) like this:

    fnc_ptr = real_function;

    Where real_function could be:

    void real_function (void);
    {
    ...
    }

    Now when you call fnc_ptr() the function real_function will be
    executed.

    Don't have answers to the rest of the top of my head... sorry.

    Best regards,
    Alastair
     
    Alastair, Jan 3, 2006
    #6
  7. Rajnee Kanth

    Flash Gordon Guest

    Alastair wrote:

    Please provide context when replying, people might not have seen the
    post you are replying to. See http://cfaj.freeshell.org/google/ for details.

    > I may have some "helpful" information with regard to Virtual functions
    > - however looking at the replies that you have got I am not sure that
    > this is the correct term:
    >
    > I use the term "Virtual" function on C to mean a function pointer.


    I've never heard the term virtual function used to describe a function
    pointer in C. The correct terms for a function pointer, as far as I can
    tell are "function pointer" and "pointer to a function".

    <snip>

    > Don't have answers to the rest of the top of my head... sorry.


    Well, we tend to discourage doing peoples homework for them anyway,
    although helping when someone has made the effort is another matter.
    --
    Flash Gordon
    Living in interesting times.
    Although my email address says spam, it is real and I read it.
     
    Flash Gordon, Jan 3, 2006
    #7
  8. Rajnee Kanth

    pemo Guest

    "Alastair" <> wrote in message
    news:...
    >I may have some "helpful" information with regard to Virtual functions
    > - however looking at the replies that you have got I am not sure that
    > this is the correct term:
    >
    > I use the term "Virtual" function on C to mean a function pointer.
    >
    > For example if we declare a virtual function (function pointer named
    > fnc_ptr) like this:
    > void (*fnc_ptr) (void);
    >
    > Then later we can make this function pointer point to a real function
    > (i.e. the address of the function in memory) like this:
    >
    > fnc_ptr = real_function;
    >
    > Where real_function could be:
    >
    > void real_function (void);
    > {
    > ...
    > }
    >
    > Now when you call fnc_ptr() the function real_function will be
    > executed.
    >
    > Don't have answers to the rest of the top of my head... sorry.


    Quite a reasonable definition, but, as the term doesn't appear in the C
    stds, not one that will draw many positive comments I fear ['cept.mine
    maybe]
     
    pemo, Jan 3, 2006
    #8
  9. Rajnee Kanth

    Randy Howard Guest

    Rajnee Kanth wrote
    (in article
    <>):

    > Hi,
    >
    > I want some info on the following items....send me what ever info u
    > have pls.....


    That is not English. The convention here is to post in English,
    so any help you can provide in that area would be appreciated.
    "u" and "pls" are not words in this language.

    > 1) Segmentaion Voilation


    That is when the compiler sees a segment, and cries out "Voila!"
    and everyone claps.

    > 2) Shared Objects files


    This requires Samba or an equivalent.

    > 3) Virtual Functions


    Ask down the hall.

    > 4) How can I call a c function in a c++ program and vice versa?


    Didn't your professor cover this in class? (Note: Even if he
    did, he probably got it wrong)

    > 5) what is the default size of a stack and heap ?


    It depends.

    > 6) Signalling in UNIX


    It is very interesting. Reading the documentation can be
    illuminating in this area, as in most others.

    > Pls do the needful.


    Which needful are you referring to here? Homeless people?
    Assault victims?


    --
    Randy Howard (2reply remove FOOBAR)
    "The power of accurate observation is called cynicism by those
    who have not got it." - George Bernard Shaw
     
    Randy Howard, Jan 3, 2006
    #9
  10. Rajnee Kanth

    Randy Howard Guest

    Eric Sosman wrote
    (in article <>):

    >> 6) Signalling in UNIX

    >
    > UNIX is off-topic here. Try alt.lang.cobol.


    First time in a while I have literally burst out laughing
    reading this group. :)


    --
    Randy Howard (2reply remove FOOBAR)
    "The power of accurate observation is called cynicism by those
    who have not got it." - George Bernard Shaw
     
    Randy Howard, Jan 3, 2006
    #10
  11. Rajnee Kanth

    Randy Howard Guest

    pemo wrote
    (in article <dpe4u0$c3b$>):

    >
    > "Christopher Benson-Manica" <> wrote in message
    > news:dpdut0$br3$...
    >> Eric Sosman <> wrote:
    >>
    >>> You've misspelled "virtuous." A virtuous function is one
    >>> that has no side-effects; these are also called "pure" functions.

    >>
    >> I thought a "virtuous" function was one that behaved the way the
    >> programmer intended. :)

    >
    > No, that's a 'lucky one'!


    It depends. What the programmer "intends" can often be
    incorrect, especially in the early stages, so following
    intention (rather than what is really needed) might be unlucky
    in such cases.


    --
    Randy Howard (2reply remove FOOBAR)
    "The power of accurate observation is called cynicism by those
    who have not got it." - George Bernard Shaw
     
    Randy Howard, Jan 3, 2006
    #11
  12. Rajnee Kanth

    Alastair Guest

    > >
    > > I use the term "Virtual" function on C to mean a function pointer.

    >
    > I've never heard the term virtual function used to describe a function
    > pointer in C. The correct terms for a function pointer, as far as I can
    > tell are "function pointer" and "pointer to a function".


    Yeah, well its basically a "slang" word in C - I have heard it used.
    But I get the impression that Ranjee maybe looking for C++ definitions.

    > > Don't have answers to the rest of the top of my head... sorry.

    >
    > Well, we tend to discourage doing peoples homework for them anyway,
    > although helping when someone has made the effort is another matter.


    Ok - I can see that this is a fairly unforgiving group! - but I'll go
    with the locals rules.
    Alastair
     
    Alastair, Jan 4, 2006
    #12
  13. Rajnee Kanth

    Randy Howard Guest

    Alastair wrote
    (in article
    <>):

    >> Well, we tend to discourage doing peoples homework for them anyway,
    >> although helping when someone has made the effort is another matter.

    >
    > Ok - I can see that this is a fairly unforgiving group! - but I'll go
    > with the locals rules.
    > Alastair


    What is it that you find unforgiving about not doing someone
    else's homework for them? You think people that want to get
    grades based upon false pretenses are deserving of support and
    admiration?

    --
    Randy Howard (2reply remove FOOBAR)
    "The power of accurate observation is called cynicism by those
    who have not got it." - George Bernard Shaw
     
    Randy Howard, Jan 4, 2006
    #13
  14. Rajnee Kanth

    Flash Gordon Guest

    Alastair wrote:
    >>> I use the term "Virtual" function on C to mean a function pointer.

    >> I've never heard the term virtual function used to describe a function
    >> pointer in C. The correct terms for a function pointer, as far as I can
    >> tell are "function pointer" and "pointer to a function".

    >
    > Yeah, well its basically a "slang" word in C - I have heard it used.


    Different people come across different things. Personally I try to avoid
    using terms I know have specific meanings in other languages, such as
    virtual, unless saying something like, "you could implement something
    like virtual functions using function pointers."

    > But I get the impression that Ranjee maybe looking for C++ definitions.


    Indeed.

    >>> Don't have answers to the rest of the top of my head... sorry.

    >> Well, we tend to discourage doing peoples homework for them anyway,
    >> although helping when someone has made the effort is another matter.

    >
    > Ok - I can see that this is a fairly unforgiving group! - but I'll go
    > with the locals rules.


    Not a problem and it was not intended as an attack on you. It's just
    that people won't learn by getting others to do their homework, and it
    is also not fair on the people who actually do the work themselves if we
    do the work for some people.
    --
    Flash Gordon
    Living in interesting times.
    Although my email address says spam, it is real and I read it.
     
    Flash Gordon, Jan 4, 2006
    #14
  15. Rajnee Kanth

    Alastair Guest

    > >>> I use the term "Virtual" function on C to mean a function pointer.
    > >> I've never heard the term virtual function used to describe a function
    > >> pointer in C. The correct terms for a function pointer, as far as I can
    > >> tell are "function pointer" and "pointer to a function".

    > >
    > > Yeah, well its basically a "slang" word in C - I have heard it used.

    >
    > Different people come across different things. Personally I try to avoid
    > using terms I know have specific meanings in other languages, such as
    > virtual, unless saying something like, "you could implement something
    > like virtual functions using function pointers."


    That's probably a good policy.

    >
    > >>> Don't have answers to the rest of the top of my head... sorry.
    > >> Well, we tend to discourage doing peoples homework for them anyway,
    > >> although helping when someone has made the effort is another matter.

    > >
    > > Ok - I can see that this is a fairly unforgiving group! - but I'll go
    > > with the locals rules.

    >
    > Not a problem and it was not intended as an attack on you. It's just
    > that people won't learn by getting others to do their homework, and it
    > is also not fair on the people who actually do the work themselves if we
    > do the work for some people.
    > --


    Ok, I'm sorry - I have been having a hard time since I started using
    this whole newsgroup thing yesterday... I have just found that people
    are a bit hard/sarcastic on you if you ask a "wrong" question! -
    anyway... no problems here!
     
    Alastair, Jan 4, 2006
    #15
  16. Rajnee Kanth

    Flash Gordon Guest

    Alastair wrote:

    Please leave in the attributions, the lines that tell us who said what,
    such as the "Alastair wrote" line above.

    <snip>

    > Ok, I'm sorry - I have been having a hard time since I started using
    > this whole newsgroup thing yesterday... I have just found that people
    > are a bit hard/sarcastic on you if you ask a "wrong" question! -
    > anyway... no problems here!


    Yes, it can be hard so you need to develop a thick skin. However, most
    of it is not meant personally, and some of it is just cultural
    differences (what is considered acceptable or a joke in one country is
    considered insulting somewhere else). However, if you can stand it then
    there is a lot of expertise here that you (and I) can learn from.
    --
    Flash Gordon
    Living in interesting times.
    Although my email address says spam, it is real and I read it.
     
    Flash Gordon, Jan 4, 2006
    #16
  17. "Alastair" <> writes:
    [snip]
    > Ok, I'm sorry - I have been having a hard time since I started using
    > this whole newsgroup thing yesterday... I have just found that people
    > are a bit hard/sarcastic on you if you ask a "wrong" question! -
    > anyway... no problems here!


    Part of the problem is that we get a *lot* of off-topic questions
    here. Many of them are unintentional, e.g., from people who assume
    that anything relating to any C implementation is topical here. Too
    many, though, are from trolls who know the conventions we've been
    following here for many years, but insist on disrupting the newsgroup.

    It's been suggested that we should expand the scope of the newsgroup
    to include implementation-specific topics as long as they're related
    to C. Our neighbors in comp.lang.c++ tried that some years ago, and
    it almost destroyed the newsgroup.

    The result is sometimes that an innocent newbie will sometimes get the
    brunt of years of frustration. (The trolls find this all amusing for
    some unfathomable reason.)

    Be patient, don't take it personally, and ignore the trolls.
    And welcome to the group.

    --
    Keith Thompson (The_Other_Keith) <http://www.ghoti.net/~kst>
    San Diego Supercomputer Center <*> <http://users.sdsc.edu/~kst>
    We must do something. This is something. Therefore, we must do this.
     
    Keith Thompson, Jan 4, 2006
    #17
  18. On Tue, 03 Jan 2006 08:09:05 -0500, Eric Sosman
    <> wrote:
    <snip mostly good DYODH>
    > > 4) How can I call a c function in a c++ program and vice versa?

    >
    > Not possible, in either direction. All functions in
    > a C program are C, so there are no C++ functions to call.


    True.

    > Similarly, a C++ program contains only C++ functions (some
    > may look a lot like C, but if they reside in a C++ program
    > the C++ rules prevail).
    >

    Not. C++ actually allows all three cases: C++ functions with C++
    linkage, C++ functions with C linkage, and true C functions with C
    linkage. It's still offtopic in clc, and I'd bet a FAQ in clc++.

    - David.Thompson1 at worldnet.att.net
     
    Dave Thompson, Jan 11, 2006
    #18
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Gilles Kuhn
    Replies:
    0
    Views:
    444
    Gilles Kuhn
    Sep 15, 2003
  2. Bart Van Hemelen
    Replies:
    2
    Views:
    4,683
    Bart Van Hemelen
    Sep 4, 2006
  3. Larry Bud
    Replies:
    13
    Views:
    7,714
    Larry Bud
    Jan 7, 2008
  4. Ben
    Replies:
    2
    Views:
    910
  5. Anjan Bhowmik
    Replies:
    1
    Views:
    481
    Misbah Arefin
    Feb 14, 2008
Loading...

Share This Page