Thread: C++ Dev Graphics got error "Main Must Return 'int'

  1. #1
    Registered User
    Join Date
    Apr 2016
    Posts
    7

    C++ Dev Graphics got error "Main Must Return 'int'

    I attached the Screenshot please help me
    C++ Dev Graphics got error "Main Must Return 'int'-main-must-return-int-jpg

  2. #2
    Registered User
    Join Date
    May 2010
    Posts
    4,478
    So what don't you understand?

    The function main() must be defined to return an int and you should return an int from this function.

    Code:
    int main()
    {
    
       return 0;
    }
    Jim

  3. #3
    Registered User
    Join Date
    Oct 2006
    Posts
    3,445
    What's the problem? Main must return int. It's a rather important part of standard C++. What part is confusing?
    What can this strange device be?
    When I touch it, it gives forth a sound
    It's got wires that vibrate and give music
    What can this thing be that I found?

  4. #4
    Registered User
    Join Date
    Apr 2016
    Posts
    7
    it is not working where can i put this

  5. #5
    Registered User
    Join Date
    Apr 2016
    Posts
    7
    confusing is this how fix it

  6. #6
    Registered User
    Join Date
    Oct 2006
    Posts
    3,445
    Quote Originally Posted by Tasawar View Post
    it is not working where can i put this
    Did you even write this program?
    What can this strange device be?
    When I touch it, it gives forth a sound
    It's got wires that vibrate and give music
    What can this thing be that I found?

  7. #7
    Registered User
    Join Date
    Jun 2011
    Posts
    4,509
    It appears this code was downloaded from a terrible "graphics in C" tutorial on youtube.

    @OP: Avoid learning from anything that references "Turbo C". If you're looking to do console "graphics", look into libraries such as "curses" instead.

    I'd also suggest you avoid video tutorials as well (especially ones that rely on outdated software, and ones that have spelling mistakes in their main graphics), and instead get yourself a decent book to learn from.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Replies: 10
    Last Post: 04-16-2014, 06:58 AM
  2. Replies: 5
    Last Post: 08-01-2013, 12:10 PM
  3. Replies: 9
    Last Post: 04-18-2011, 11:39 AM
  4. error when return 0; in int main()w
    By elninio in forum C++ Programming
    Replies: 19
    Last Post: 09-18-2008, 02:32 AM
  5. void main() return error code 0 ?
    By Manish in forum C Programming
    Replies: 7
    Last Post: 02-16-2002, 02:07 AM

Tags for this Thread