|
-
October 3rd, 2007, 03:36 AM
#1
Senior Member
C pointers and arrays?
OK, as I understand it - and I may be wrong here - in the C programming language, pointers and arrays are "unified" meaning the following code snippet should compile:
Code:
char *msg;
msg = "Goodbye, Cruel World!";
char c;
c = msg[5];
But if I want to have a 2 dimensional array represented as a pointer, what do I do?
Like I want to have an array of character pointers, but I don't know how long the array will be and size is kind of an issue. (With using a character pointer instead of an array, the size of the character pointer is always 4 on my 32 bit machine; I found this out using the sizeof() operator.)
Is it possible to use a pointer to a pointer of a char and use it as a two dimensional array?
"The Texan turned out to be good-natured, generous and likeable. In three days no one could stand him." Catch 22 by Joseph Heller.
Buddies? I have no buddies...
Give the BSD daemon some love (proud FreeBSD user) 
Similar Threads
-
By shred2er in forum Programming Security
Replies: 6
Last Post: September 29th, 2003, 02:25 AM
-
By White_Eskimo in forum Programming Security
Replies: 12
Last Post: August 8th, 2003, 12:03 AM
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
|