Error expected '=', ',' ,'asm', 'or' before token '{'

This is a discussion on Error expected '=', ',' ,'asm', 'or' before token '{' within the C Programming forums, part of the General Programming Boards category; Why do i keep this error? int main() { It happens on the same line as { It wouldn't make ...

  1. #1
    Registered User
    Join Date
    Oct 2012
    Posts
    140

    Error expected '=', ',' ,'asm', 'or' before token '{'

    Why do i keep this error?

    int main()
    {

    It happens on the same line as {


    It wouldn't make sense to put a =, or, ; right after main right?

  2. #2
    Registered User camel-man's Avatar
    Join Date
    Jan 2011
    Location
    Under the moon
    Posts
    643
    Post your entire code.

  3. #3
    Registered User
    Join Date
    Oct 2012
    Posts
    140
    I think i figured it out haha.

    I had int main

    and then i had a function below it. I included the other function within my main function without closing my main function first.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. error: expected ) before * token
    By evb@studioe.com in forum C Programming
    Replies: 4
    Last Post: 01-10-2012, 02:13 PM
  2. Error: expected identifier or ( before { token
    By jpcanaverde in forum C Programming
    Replies: 66
    Last Post: 06-08-2010, 01:53 PM
  3. error: expected unqualified-id before '{' token
    By fhbwghads in forum C++ Programming
    Replies: 5
    Last Post: 12-25-2008, 04:39 AM
  4. error: expected unqualified-id before '=' token
    By (::) in forum C++ Programming
    Replies: 2
    Last Post: 05-17-2008, 12:50 AM
  5. error: expected ; before : token
    By kris.c in forum C Programming
    Replies: 5
    Last Post: 02-10-2008, 10:26 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21