S
s4tanu
Hi,
char arr_one[] = {'a','b','c','d','\0'};
i want to make another array with same size as 'arr_one'
if i do like this -
size_t len= strlen(arr);
char arr_two[len];
when i complied this code
my gcc (ver 4) gives warning
warning: ISO C90 forbids variable-size array ‘arr_one’
it means i should not put variable name inside array brackets ?
if i write code like this -> arr_two[len] is this the wrong way to
write ?
Thanks for your suggestion
char arr_one[] = {'a','b','c','d','\0'};
i want to make another array with same size as 'arr_one'
if i do like this -
size_t len= strlen(arr);
char arr_two[len];
when i complied this code
my gcc (ver 4) gives warning
warning: ISO C90 forbids variable-size array ‘arr_one’
it means i should not put variable name inside array brackets ?
if i write code like this -> arr_two[len] is this the wrong way to
write ?
Thanks for your suggestion