Structure size so big, need optimization

Your Test structure is quite large, 588,000 bytes, which might be too large for automatic storage. Make it static should solve the problem, but will make your code non reentrant and definitely not thread safe. If the problem is with the maximum packet size, you must break the transmission into smaller packets. Use a smaller … Read more

How come when I try to compile my C program by making a file named for the program it creates an application for it?

It is normal for the compiler to generate an application! What is surprising is the location for the executable, it should have been generated in the parent directory: C:\TDM-GCC-64\> gcc Chess/chess.c Chess/init.c -o chess The explanation is interesting: You are using the Windows operating system, where the filenames are case insensitive. You instructed gcc to … Read more

Program is working on code block but not in hacker rank

let’s walk through your code: malloc(sizeof(int) * num), what is the value of num ? scanf(“%d”,num), check the return value of scanf ( number of element successfully parsed by scanf ) for( i = 0 ; i < num; i++ ), loop with i from 0 to num scanf(“%llu”,&num_alloc[num]), read number and store it in … Read more