c - It's possible to make typedef or define char pointer with malloc? -
What I want to do is like string256 act: four * s = (char *) malloc (256);
string256s; / * Iam * / char * s = (char *) malloc (256); / * For this how it looks in real life * /
and use it
strncpy ("__test__", 9 ) Is [9] = 0x00;
PS Typedef or defined or function code length does not matter only string 256S; I will not forget to use free or error checking;
The full code will look like this:
__Free_String_if_Flag_true __Zero_Memory __check_for_Errors __string_256 string256
and use it
string256s;
You can make a typedef of a four array: When the variable will be closed out of the current area, but you can global it if you want it continuously.
typing four char 256 [256]; Four 256s; S [255] = '\ 0';
Comments
Post a Comment