# Microsoft Visual C++ 2010 Express, I can't compile anything.



## Phoenixxdown (Jun 12, 2012)

I just started learning C from learnconline.com. I tried to compile this code:


```
#include <stdio.h>
#include <conio.h>

Void main()
{
	int a, b, c;
	a = 5;
	b = 4;
	c = a + b;
	printf("\nAddition of a and b is %d", c);
}
```
And I got this output:


```
1>------ Build started: Project: learnconline, Configuration: Debug Win32 ------
1>  lesson6.c
1>c:\users\hett\documents\visual studio 2010\projects\learnconline\learnconline\lesson6.c(4): error C2061: syntax error : identifier 'main'
1>c:\users\hett\documents\visual studio 2010\projects\learnconline\learnconline\lesson6.c(4): error C2059: syntax error : ';'
1>c:\users\hett\documents\visual studio 2010\projects\learnconline\learnconline\lesson6.c(4): error C2059: syntax error : ')'
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
```
The code is in an empty Visual C++ project as a source file. I made sure to save the file as C, not C++. I've gotten similar errors with everything I tried to compile, including several code samples from other websites. What am I doing wrong?


----------



## liamm (Jan 6, 2012)

there are a few problems:
1. C is case sensitive. so either void main(). ori int main(). I preffer int main, and put a return 0 before the ending of the program. This communicates to the OS that everything went well.
2. you initialize c with the value of other variables. This should work, but it just might not. VS though is good enough to skip this small thing. 

have a getch() function, or whatever you use in conio.h, so you can see the program, otherwise it will end before you can see something.


----------



## Phoenixxdown (Jun 12, 2012)

All I had to do was type "void" instead of "Void". Using int main worked, too. I wonder if there were other tiny errors like that in the codes that I copied. Hopefully this works for the other codes, too. Thank you!

Unfortunately, I'm so new at this that I don't even know how to use getch(), but I'll get there.


----------

