[Courses] Re: pointers, array's, and sizeof()

Xp0nential Xp0nential Xp0nential at root-core.com
Sun Feb 3 11:36:38 EST 2002


><huge ass snip>
yay !!!

we are of course discussing C. ANSI C. not C++ !!

I don't know anything about C++....... and how the array pointer relation is.

What I discussed is a ANSI C standard.
I am not creating those stuff ;)

regards,
Xp0nential

--- coldfire <rolick571 at duq.edu> wrote:
>> wrong wrong.
>> it is only in function parameters out of convenience that the compiler
>> when it sees char a[] for example, will  treat it as  if it was char a*;
>> <-- notice will be treated not converted...
>> and thats only in function parameters !!
>
><huge ass snip>
>
>are we discussing purely C?  or C++?  if C++ ...
>
>        int a[5] = {1, 2, 3, 4, '\0'};
>	cout << a << endl;
>        cout << *a << endl;
>
>run the above code:
>
>	# ./a.out
>	0xbffff788
>	1
>
>ok, the formal definition of a pointer?  "a pointer stores an address in
>memory."  as indicated, 'a' is merely a pointer.  hence the pointer
>notation i used in a previous email.  *(a+0), *(a+1), *(a+2), etc. will
>print the contents of the array.
>
>
>coldie
>
>_______________________________________________
>Courses mailing list
>Courses at linuxchix.org
>http://mailman.linuxchix.org/mailman/listinfo/courses

_____________________________________________________________
[Root-Core Network] - [www.root-core.org] - Free E-mail



More information about the Courses mailing list