473,414 Members | 1,684 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,414 software developers and data experts.

error problen 'unexpected end of file'

4
Hello..
I have a problem when I compile the .cpp file, an error is occurred 'unexpected end of file ' plz help me why does it happen .
Apr 21 '07 #1
5 1890
JosAH
11,448 Expert 8TB
Count and match your curly brackets; you missing at least one rigth curly bracket.

kind regards,

Jos
Apr 21 '07 #2
eshuv
4
Count and match your curly brackets; you missing at least one rigth curly bracket.

kind regards,

Jos
hi Jos thanks .
I have check it twice there is no such brakets missing. I am tring it again . Tell me may be the another reason of it .
Apr 21 '07 #3
JosAH
11,448 Expert 8TB
hi Jos thanks .
I have check it twice there is no such brakets missing. I am tring it again . Tell me may be the another reason of it .
Check your literal strings too " ... "; if you forget the closing double quote the
compiler expects more text while the end of your file has been reached. Also
check your parentheses etc. Most of the time the curly brackets are the
guilty ones.

kind regards,

Jos
Apr 21 '07 #4
weaknessforcats
9,208 Expert Mod 8TB
If you are using Visual Studio, each file must end with a line consisting of just the enter key.

Edit each nof your files and be sure there is an empty line at the end. This will be easy to see by going to the end of the file and looking at the cursor. If it's not in col 1 of a new line, then press enter.
Apr 21 '07 #5
Banfa
9,065 Expert Mod 8TB
If you are using Visual Studio, each file must end with a line consisting of just the enter key.
I have to say that I have never noticed that with visual studio. However it is part of the C and C++ standards that every line containing code must end with a newline, and I have come across a few compilers that check for this (Visual Studio not being one of them up to now), this causes a problem if for instance you don't put a newline after the closing brace of the last function in the file (something that is not visually obvious in most editors).


Another cause of you problem could be poorly positioned /closed comments. Although less likely in these days of chroma coded editors where commented out code is normally obvious if you accidentally managed to comment out a closing brace this would have the same effect as leaving it out.

It is of course possible to achieve the same effect with preprocessor directives (#if etc) instead of comments.
Apr 22 '07 #6

Sign in to post your reply or Sign up for a free account.

Similar topics

5
by: Tony Wright | last post by:
Hi, I am having a problem installing an msi for a web site. The error message I am getting is: "The specified path 'http://mipdev05/features/Fas2' is unavailable. The Internet Information...
2
by: Petar Popara | last post by:
This is from Event Viewer. What is it? Error: Script Engine Exception. A ScriptEngine threw expection 'C0000005' in 'IActiveScript::SetScriptState()' from ...
5
by: Enos Meroka | last post by:
Hallo, I am a student doing my project in the university.. I have been trying to compile the program using HP -UX aCC compiler, however I keep on getting the following errors. ...
7
by: p | last post by:
WE had a Crystal 8 WebApp using vs 2002 which we upgraded to VS2003. I also have Crystal 9 pro on my development machine. The web app runs fine on my dev machine but am having problems deploying....
4
by: Al Williams | last post by:
Hi, I have error handling in place throughout my application. I also start the application wrapped in error handling code to catch any unexpected exceptions (i.e. exceptions that occur where I...
5
by: r.nikhilk | last post by:
Hi, Currently, we are porting C++ applications from 32 bit to 64 bit on AIX platform. (The current version of AIX is 5.3 and xlC verison is 8.0). We are able to compile the applications by...
2
by: Lawrence Krubner | last post by:
Imagine a template system that works by getting a file, as a string, and then putting it through eval(), something like this: $formAsString = $controller->command("readFileAndReturnString",...
13
by: bytesc | last post by:
Hey guys, I have created many picture files using gd_library, I recently decided to rename all of my pictures files on my web server to text instead of just numbers. Example: productsssh.jpg ...
4
by: amey72 | last post by:
Hi, I am trying to connect to a COM component using PHP, but keep on recieving an "Unexpected error has occured" message. The COM component code is Option Explicit Public Enum...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.