ERROR Register = 0

This is a discussion on ERROR Register = 0 within the C Programming forums, part of the General Programming Boards category; My code compiles an error , it says: main.c(18) E4062C: syntax error near `=' main.c(24) E4062C: syntax error near `register' ...

  1. #1
    Registered User
    Join Date
    Nov 2007
    Posts
    19

    ERROR Register = 0

    My code compiles an error, it says:

    main.c(18) E4062C: syntax error near `='
    main.c(24) E4062C: syntax error near `register'


    Can someone see what I am doin wrong here?
    Attached Files Attached Files

  2. #2
    Kernel hacker
    Join Date
    Jul 2007
    Location
    Farncombe, Surrey, England
    Posts
    15,677
    "register" is a keyword in C, so you can't use that as a variable or function name.

    --
    Mats
    Compilers can produce warnings - make the compiler programmers happy: Use them!
    Please don't PM me for help - and no, I don't do help over instant messengers.

  3. #3
    Registered User
    Join Date
    Nov 2007
    Posts
    19
    What other options are possible for me to use then?

  4. #4
    Kernel hacker
    Join Date
    Jul 2007
    Location
    Farncombe, Surrey, England
    Posts
    15,677
    Well, call the variable something else than exactly "register" would be an obvious one. Some choices I could think og: "reg", "regvalue", "regaddr", "Register", "REGISTER".

    It's the same as you can't call a variable "for", "while", "do", "if", "else", etc, etc.

    --
    Mats
    Compilers can produce warnings - make the compiler programmers happy: Use them!
    Please don't PM me for help - and no, I don't do help over instant messengers.

  5. #5
    Registered User
    Join Date
    Nov 2007
    Posts
    19
    Well thank you very much! I will try your options

Popular pages Recent additions subscribe to a feed

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