|
-
how do i allocate a dynamic char* in C ?
I want to declare a data type of char*, but I do not know the # of characters I will be needed. Is there anyway to increase the size of such variable as I go along? (e.g. when i run out of space)
I can't work around by doing this:
char* a = new char [myInt];
because by the time of declaring this statement, I still dont know the size of the char*. btw, I need to use char* data type.
any advises?
DHAHL3seasons GP:73 G:121 A:55 Pts:176 GWG:12 +/-:184
UWSWA6seasons GP:41 G:53 A:46 Pts:99 GWG:5 +/-:-25
MCBHL3seasons GP:14 G:20 A:8 Pts:28 GWG:4 +/-:19
uwcdc.com or monkis.com
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
|
|