User Profile

Collapse

Profile Sidebar

Collapse
emorrp1
emorrp1
Last Activity: Jun 25 '08, 03:07 PM
Joined: Jun 24 '08
Location:
  •  
  • Time
  • Show
  • Source
Clear All
new posts

  • emorrp1
    replied to struct member assignment (c-only)
    in C
    I'm not claiming it's ANSI/ISO standard. But I now know, the reason it's void main() for microprocessors is because there's no operating system to return the int to, and most microprocessor programs end in an infinite loop, so a return value would be useless anyway....
    See more | Go to post

    Leave a comment:


  • emorrp1
    replied to struct member assignment (c-only)
    in C
    maybe not, but microcontroller s do strange things, including expecting main() to be declared as void (for the one I'm working on at the moment)...
    See more | Go to post

    Leave a comment:


  • emorrp1
    replied to struct member assignment (c-only)
    in C
    The solution (from another board) is:

    "The reason you get an error on the int a ... is that you are not defining your variables before the start of code. In C++ you can literally put a variable definition anywhere any statement can go. Some C compilers allow this too, but far from all. So as soon as you start writing code statements (anything that isn't a type, function or variable declaration/definition), you can not declare...
    See more | Go to post

    Leave a comment:


  • emorrp1
    started a topic struct member assignment (c-only)
    in C

    struct member assignment (c-only)

    Hi, I'm now in a job where I have to code in pure C (not C++) and am having trouble adjusting to the differences, hope you can help. As soon as I un-comment any one of the commented lines in the code snippet below, the program fails to compile with a syntax error on the "int a=0..." line after the commented block (This line isn't a problem while the rest is commented out). I haven't been able to identify the problem, even after searching...
    See more | Go to post
No activity results to display
Show More
Working...