New to C, thanks a lot for help.
Is it possible to define an array in C without either specifying its size or initializing it.
For example, can I prompt a u
If you're a beginner, maybe you don't want to deal with malloc and free yet. So if you're using GCC, you can allocate variable size arrays on the stack, just specifying the size as an expression.
For example:
#include
void dyn_array(const unsigned int n) {
int array[n];
int i;
for(i=0; i
But keep in mind that this is a non standard extension, so you shouldn't count on it if portability matters.