Solved

error: illegal token at line xxxx

Posted on 1998-12-29
2
230 Views
Last Modified: 2013-12-26
I am getting a compile error: illegal token in main.c at line 126, what does this error mean. The code looks fine but the error goes away when I block out the code the error is pointing too.
0
Comment
Question by:dwp090598
2 Comments
 
LVL 3

Accepted Solution

by:
boonstra earned 50 total points
ID: 1291686
I suspect this is code that you cut and pasted from Experts Exchange.  For some reason, it introduces characters that are illegal in C.  What your code had looked like:
         /*      if( 1 )
                    {
                          //notHandled = true;
                          //dlgP = (DialogPeek)aWindow;
                    
      
                  } */

but the hex dump was:
0000: 09 20 20 20 2F 2A 09 69 66 28 20 31 20 29 20 0D       .   /*.if( 1 ) .
0010: 09 20 20 09 09 7B 20 0D 09 20 20 09 09 09 2F 2F       .  ..{ ..  ...//
0020: 6E 6F 74 48 61 6E 64 6C 65 64 20 3D 20 74 72 75       notHandled = tru
0030: 65 3B 0D 09 20 20 09 09 09 2F 2F 64 6C 67 50 20       e;..  ...//dlgP
0040: 3D 20 28 44 69 61 6C 6F 67 50 65 65 6B 29 61 57       = (DialogPeek)aW
0050: 69 6E 64 6F 77 3B 20 0D CA CA CA CA CA CA CA CA       indow; .        
0060: 09 09 0D 09 0D 09 09 09 7D 20 2A 2F 0D                ........} */.

Note the 0xCA characters in the hex dump.

Solution is to retype the posted code rather than cut and paste.
0
 

Author Comment

by:dwp090598
ID: 1291687
Boonstra has answered my question perfectly as usual!
0

Featured Post

ScreenConnect 6.0 Free Trial

Want empowering updates? You're in the right place! Discover new features in ScreenConnect 6.0, based on partner feedback, to keep you business operating smoothly and optimally (the way it should be). Explore all of the extras and enhancements for yourself!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
has77  challenge 9 85
Window placement 17 83
wordcount challenge 11 121
"Black Box" Testing of Control System Software 2 51
Introduction: Displaying information on the statusbar.   Continuing from the third article about sudoku.   Open the project in visual studio. Status bar – let’s display the timestamp there.  We need to get the timestamp from the document s…
Introduction: Ownerdraw of the grid button.  A singleton class implentation and usage. Continuing from the fifth article about sudoku.   Open the project in visual studio. Go to the class view – CGridButton should be visible as a class.  R…
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…

810 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question