Based on GeeksforGeeks and many other sites, the C/C++ compilers will create the same token for
However if we have something like this:
then will there be a parser error or semantic error?
The book that I'm reading says the parser rather than the semantic routines will detect it, but after the lexical analysis wouldn't that be converted to this:
10.5 will be converted to a
Constants token based on that website? Therefore the parser will not notice this is an error because both of
10.5 will be
So which one is right? Will the parser or one of the semantic routines detects this error? Do the C/C++ compilers create the same tokens for int numbers and floats?