Re: [Code] general

From: James Fogarty (jfogarty@vt.edu)
Date: 01/27/97


ok i'll give a shot at a reply..

int* or char* or float* or whatnot are called pointers.. char* message does
not actually contain whatever string exists as message.. it contains the
memory address where the array containing the string starts..  thus you
still have to declare the array containing the message with a normal char
name[size] declaration.. then set char=&name and wow you can refer to name[]
as *name.. see what i mean?  anyways the concept is known as pointers, if
you need more you can probably find something somewhere on the internet about it

At 12:18 AM 1/27/97 -0500, Mehdi Keddache wrote:
>Hello, I never could figure out why when you declare a variable like that
>char *message;
>and you use this variable in a printf you get a segfault
>printf("this is the value of message: %s\r\n",message);
>It has nothing to do with the mud but maybe someone knows.
>thanks
>Mehdi Keddache (Heritsun on Eclipse of Fate eclipse.argy.com 7777)
>
>
>+-----------------------------------------------------------+
>| Ensure that you have read the CircleMUD Mailing List FAQ: |
>|   http://cspo.queensu.ca/~fletcher/Circle/list_faq.html   |
>+-----------------------------------------------------------+
>
_____________________________________________
If at first you don't succeed, try, try again.
Then quit. There's no use being a damned fool about it.
	       -W.C. Fields

+-----------------------------------------------------------+
| Ensure that you have read the CircleMUD Mailing List FAQ: |
|   http://cspo.queensu.ca/~fletcher/Circle/list_faq.html   |
+-----------------------------------------------------------+



This archive was generated by hypermail 2b30 : 12/18/00 PST