Using #define in defining string size C -


i'm beginner in c , want ask difference in memory allocation procedure in 2 different codes mentioned below:

#define max_len 10000 int main() { char str_new[max_len]; ... }   int main() { char str_new[10000]; ... } 

are these 2 not same essentially?? memory not allocated in same way in these two? not answered in questions searched. although both different methods used frequently.

they both equivalent. in first program macro max_len replaced 10000 simple textual substitution.


Comments

Popular posts from this blog

css - Which browser returns the correct result for getBoundingClientRect of an SVG element? -

gcc - Calling fftR4() in c from assembly -

.htaccess - Matching full URL in RewriteCond -