scanf crashes every time when running a c code in CLion whereas in Code:Blocks it works as expected

Sample of the codes is as follows:

int search;
printMenu();
printf("Enter your selection: ");
scanf("%d",&search);

As mentioned in the title it works everytime in Codeblocks. I experimented with both the MinGW and Visual Studio toolchains with the same results.

 

1 comment
Comment actions Permalink

Hello!

What error do you get?

0

Please sign in to leave a comment.