- Apr 14, 2013
- 4,834
- 1,204
- 146
In my PC programming class we're learning straight up C. Whether it's a good start or not doesn't really matter to me at the moment, but I can't get anything C to run in visual studio. I know it's built for a language that wasn't obsolete 20 years ago, but I need to make it work. The program we usually use for writing, compiling, and then running C is DevC++, but the last update to that program was nearly 20 years ago and I can't get it to work on windows 10.
An example of code that runs in DevC++ but not visual studio is this;
All I get from visual studio is this;
and then when the program fails;
any and all help would be appreciated.
An example of code that runs in DevC++ but not visual studio is this;
Code:
//Calculates the area of a rectangle
#include <stdio.h>
#include <stdlib.h>
int main(void)
{
unsigned int length, width, area, perimeter;
printf("Enter length and width of the rectangle\n"); //prompt
scanf("%d%d", &length, &width);
area = length * width;
perimeter = length + length + width + width;
printf("Area is %d\n", area);
printf("Perimeter is %d\n\n", perimeter);
system("pause");
return 0;
}
All I get from visual studio is this;
Code:
1>------ Rebuild All started: Project: AAAAAA, Configuration: Debug Win32 ------
1> Source.c
1> *namewashere.c
1>c:\users\*names*\documents\visual studio 2015\projects\aaaaaa\aaaaaa\doublederp.c(9): error C4996: 'scanf': This function or variable may be unsafe. Consider using scanf_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
1> c:\program files (x86)\windows kits\10\include\10.0.10240.0\ucrt\stdio.h(1270): note: see declaration of 'scanf'
1> Generating Code...
========== Rebuild All: 0 succeeded, 1 failed, 0 skipped ==========
and then when the program fails;

any and all help would be appreciated.