C/C++ Help
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
User Name:
Password:
Remember me
 
Go Back   Dev Articles Community ForumsProgrammingC/C++ Help

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Display Modes
 
Unread Dev Articles Community Forums Sponsor:
  #1  
Old March 7th, 2005, 08:06 PM
trini trini is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Mar 2005
Posts: 1 trini User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 15 m 31 sec
Reputation Power: 0
parse error at end of input

Here is the piece of code I am trying to compile. I get the error :
parse error at end of input. What am I doing wrong?

//Function that appends information to log file.
void WriteToLog(int eventTime, char *IP, char *Port, char *message)
{
//Open log file
ofstream outLogFile ("log.txt", ios::app);
if (!outLogFile)
{
cerr<<"File could not be opened."<<endl;
exit(1);
}
//append information to log file
int x = atoi(Port);
outLogFile<<eventTime<<" "<<IP<<" "<<x<<" "<<message<<"\n";
outLogFile.close();
}

Reply With Quote
  #2  
Old March 8th, 2005, 08:12 AM
Anibal Anibal is offline
Contributing User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Jan 2005
Posts: 176 Anibal User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 Day 4 h 20 m 48 sec
Reputation Power: 4
Hey trini!

See the # on the editing tool bar? That's the CODE tag. When you wrap your code between those tags, it leaves the spaces on, making the code readable...Also, please, try showing somehow the line in which the error seems to apear!

Good Luck

Anibal.

Reply With Quote
Reply

Viewing: Dev Articles Community ForumsProgrammingC/C++ Help > parse error at end of input


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 3 hosted by Hostway
Stay green...Green IT