Jump to content

fml, just started already getting an error


damian

Recommended Posts

I'm learning to write C C++ and C#. This is the very first lesson in the book so im a little depressed! It says to write this code into an editor/compiler.

 

#include <studio.h>
void main(void)
{
printf ("Jamsa\'s C/C++/C# Programmer\'s Bible!");
}

 

Now when i compile that code i get an error on the last bracket. I'm thinking its because of the compiler I am using (Dev-C++) Maybe I am writing the code in the wrong editor? I'm sorry I am not more descriptive but this is my first time. I copied the code just like it was on the book so im a little flabbergasted.

Share this post


Link to post
Share on other sites

I'm learning to write C C++ and C#. This is the very first lesson in the book so im a little depressed! It says to write this code into an editor/compiler.

 

#include <studio.h>
void main(void)
{
printf ("Jamsa\'s C/C++/C# Programmer\'s Bible!");
}

 

Now when i compile that code i get an error on the last bracket. I'm thinking its because of the compiler I am using (Dev-C++) Maybe I am writing the code in the wrong editor? I'm sorry I am not more descriptive but this is my first time. I copied the code just like it was on the book so im a little flabbergasted.

 

 

As an alternative compiler you could try microsoft's free studio tools

Share this post


Link to post
Share on other sites

Change your library declarations.

 

#include <studio.h>

 

to

 

 

#include <stdio.h>

 

You also should have a return statement. Since your Main() function returns void, have this before your last bracket

 

return void;

 

And for your Main function, it's actually not in compliance with the ANSI standard for returning void.. You should have your main() function return an integer.

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
×
×
  • Create New...