need information on the following items

R

Rajnee Kanth

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.
 
P

pemo

Rajnee Kanth said:
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
 
E

Eric Sosman

Rajnee said:
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.
 
C

Christopher Benson-Manica

Eric Sosman said:
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. :)
 
A

Alastair

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
 
F

Flash Gordon

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".

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.
 
P

pemo

Alastair said:
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]
 
R

Randy Howard

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?
 
R

Randy Howard

Eric Sosman wrote
(in article said:
UNIX is off-topic here. Try alt.lang.cobol.

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

Randy Howard

pemo wrote
(in article said:
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.
 
A

Alastair

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.
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
 
R

Randy Howard

Alastair wrote
(in article
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?
 
F

Flash Gordon

Alastair said:
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.


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.
 
A

Alastair

I use the term "Virtual" function on C to mean a function pointer.
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.
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!
 
F

Flash Gordon

Alastair wrote:

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

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.
 
K

Keith Thompson

Alastair said:
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.
 
D

Dave Thompson

On Tue, 03 Jan 2006 08:09:05 -0500, Eric Sosman
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
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,768
Messages
2,569,574
Members
45,051
Latest member
CarleyMcCr

Latest Threads

Top