(Solved):slide #51 stack over flow example code void func(char *str) { char buf[16]; strcpy(buf,str); } void main() { char large_str[256]; int i; for( i = 0; i < 255; i++) large_str[i] = 'A'; func(large_str... View Answer...

 

Question

slide #51 stack over flow example code void func(char *str) { char buf[16]; strcpy(buf,str); } void main() { char large_str[256]; int i; for( i = 0; i < 255; i++) large_stri = ‘A’; func(large_str); printf(?str copied!n?); }

Prob. 1: The code in slide #51 has been slightly changed to 1 void func(char *str) { 2 char buf[16]; 3 strcpy(buf,str); 4 } 5 void

Scroll to top