Forum Discussion
Altera_Forum
Honored Contributor
20 years agoglobal pointer assignment error
Nios 5.0.1 In global scope: char test[20]="teststring"; char *cp1 = &test[0]; //this works char *cp1; cp1 = &test[0]; //but this does not It all works inside a function, ...
Altera_Forum
Honored Contributor
20 years agoBecause the first assignment is done at compile time, and second assignment must be done at run time i.e. generates code. This is only allowed inside a function. Too early in the morning...