[KLUG Programming] substr in C?

Tony Gettig programming@kalamazoolinux.org
Tue, 22 Jul 2003 13:34:49 -0400


Gentlemen,

THANK YOU!  

Dropping the * made the difference. I get confused with pointers and strings, 
and their relationship at times, but it is clearer now. An array of pointers 
takes up more space than an array of char. Man, I wish I could figure things 
out with a quick glance before lunch like that. :) 

Thanks again. I super appreciate it. See you all tonight!

Tony


Quoting "Robert G. Brown" <bob@acm.org>:

> On 22 Jul 2003 11:56:01 -0400, Bruce Smith <bruce@armintl.com> wrote:
> >> char *strTemp[255];
> >
> >With only a quick glance before lunch, I'd say lose the star.
> >
> >char strTemp[255];
> 
> *strTemp[255] is an array of 255 pointers, and strTemp+4 will compute a 4
> byte jump, since pointres are 4 byte (word length on Intel32 bit).
> 
> strTemp[255] is an array of 255 characters, strTemp+1 will be a 1 byte
> increment...
> 							Regards,
> 							---> RGB <---
> 
> _______________________________________________
> Programming mailing list
> Programming@kalamazoolinux.org
> http://www.kalamazoolinux.org/mailman/listinfo/programming
> 


-- 
Tony Gettig
Voiceovers, PGP key, and more at
http://gettig.net