-
June 28th, 2013, 09:39 AM
#1
MS compiler's text-processing
I have a source file (.cpp) that I save into my HD using a different encoding scheme than its original code page. Later I open it again with MSVS and clearly nothing looks different (no odd characters were inserted). But if I add a comment at the end of the file, e.g
Code:
class A{
void func()
{
}
//comment
}
it will report an error of "{" at line "class A{"
But if I change it into
Code:
class A{
void func()
{
}
/*comment*/
}
then the error is gone.
Could you explain why ? Thank you.
BTW, I am looking for a decent compiler book (one that is most applicable to current OSes + MSVS technologies+GnuGcc). Honestly I never took a compiler course before, all of what I know is from one of my best online professors. She was/is/will always be great to me! Best! Thank you, professor.
-
June 28th, 2013, 10:13 AM
#2
Re: MS compiler's text-processing
Originally Posted by terminalXXX
I have a source file (.cpp) that I save into my HD using a different encoding scheme than its original code page.
Could you clarify what and how you did?
Victor Nijegorodov
-
June 28th, 2013, 02:47 PM
#3
Re: MS compiler's text-processing
Originally Posted by VictorN
Could you clarify what and how you did?
It's not what I did it's someone else did and I wonder why that happened
-
June 28th, 2013, 03:44 PM
#4
Re: MS compiler's text-processing
Originally Posted by terminalXXX
It's not what I did it's someone else did and I wonder why that happened
Well, again:
- Which different encoding scheme did "someone else" use?
- How did he/she save in "different encoding scheme"?
- Which one was the original code page?
- Which version of IDE was used?
Victor Nijegorodov
-
June 28th, 2013, 09:36 PM
#5
Re: MS compiler's text-processing
Thank you VictorN, I had no idea then,.
-
June 28th, 2013, 08:46 PM
#6
Re: MS compiler's text-processing
I have a friend that did that, it broke, and then he changed it back and fix it. I have no idea what he did.
-
June 28th, 2013, 09:32 PM
#7
Re: MS compiler's text-processing
Originally Posted by Arjay
I have a friend that did that, it broke, and then he changed it back and fix it. I have no idea what he did.
Yes, and that indicates something incompletely implemented in the compiler exists because ther compiler does still accept /*..comment..*/ but not //..comment..
Last edited by terminalXXX; June 28th, 2013 at 09:36 PM.
-
June 29th, 2013, 01:33 AM
#8
Re: MS compiler's text-processing
Originally Posted by terminalXXX
I have a source file (.cpp) that I save into my HD using a different encoding scheme than its original code page. Later I open it again with MSVS and clearly nothing looks different (no odd characters were inserted).
Originally Posted by terminalXXX
Yes, and that indicates something incompletely implemented in the compiler exists because ther compiler does still accept /*..comment..*/ but not //..comment..
No, that indicates that "a different encoding schema", whatever it really is you never let us know, made the code text, though been looking "nothing different" in IDE text editor, be somehow broken at line ends (from compiler code parser perspective of course), and the single line comment made the closing curly brace be commented out along with the line.
Last edited by Igor Vartanov; June 29th, 2013 at 01:38 AM.
Best regards,
Igor
-
July 1st, 2013, 12:02 PM
#9
Re: MS compiler's text-processing
Well, that makes me think the OP may want to look into something like Windows line termination style (CR LF) vs. *nix line termination (LF only). Just an idea, though...
I was thrown out of college for cheating on the metaphysics exam; I looked into the soul of the boy sitting next to me.
This is a snakeskin jacket! And for me it's a symbol of my individuality, and my belief... in personal freedom.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|