PLease help me to make my program run

Please support our C++ advertiser: Intel Parallel Studio Home
Reply

Join Date: Oct 2004
Posts: 43
Reputation: hopeolicious is an unknown quantity at this point 
Solved Threads: 0
hopeolicious hopeolicious is offline Offline
Light Poster

PLease help me to make my program run

 
0
  #1
Nov 25th, 2004
#include<iostream.h>
#include<stdlib.h>
#include "simmons.h"

const int MAXCHARS = 500;
char st_line[MAXCHARS];
char ch_option;
int i_va;
int i_ve;
int i_vi;
int i_vo;
int i_vu;
int i_letters = 0;
int i_count = 1;
int i_number = 0;
int i_vowel = 0;
char ch_char;

void hope();
void vowels();
void letter();
void mike();

void main()
{
ifstream HopeData;
HopeData.open("getdata");
ofstream MikeData;

for(x=0;x<500;x++)
if(st_line[i_letters] == ' ' || st_line[i_letters] == '\0')
i_count--;
while(st_line[i_letters] != '\0')
{
if(st_line[i_letters + 1] != ' ' && (st_line[i_letters + 1] != ' ' && st_line[i_letters + 1] !=
'\0'))
i_count++;
i_letters++;
}
}

MikeData << "\nInputted String";
MikeData << "\n\n*******************************";
MikeData << "\n\n " << st_line;
MikeData << "\n\nNumber of a's: " << i_va;
MikeData << "\nNumber of e's: " << i_ve;
MikeData << "\nNumber of i's: " << i_vi;
MikeData << "\nNumber of o's: " << i_vo;
MikeData << "\nNumber of u's: " << i_vu;
MikeData << "\nTotal Vowels: "<< i_vowel;
MikeData << "\n\nNumber of Letters: " << i_letters;
cout << "\n\n\nDo you want to exit (Y/N)? ";
cin.get(ch_option);

void close()
{
HopeData.close();
MikeData.close();
}

this is what it said when I tried to compile it

count.cpp:94: unterminated character constant
$
Reply With Quote Quick reply to this message  
Join Date: Nov 2004
Posts: 6,143
Reputation: jwenting is just really nice jwenting is just really nice jwenting is just really nice jwenting is just really nice 
Solved Threads: 213
Team Colleague
jwenting's Avatar
jwenting jwenting is offline Offline
duckman

Re: PLease help me to make my program run

 
0
  #2
Nov 26th, 2004
And which is line 94? I'm not inclined to go count your lines and see which generated the error.

You probably have a string or character literal somewhere which doesn't have closing quotes. Or else you have a quote somewhere where it doesn't belong leading the compiler to think you declared a constant where there is none.
Reply With Quote Quick reply to this message  
Join Date: Aug 2004
Posts: 48
Reputation: Coach_Nate is an unknown quantity at this point 
Solved Threads: 0
Coach_Nate's Avatar
Coach_Nate Coach_Nate is offline Offline
Light Poster

Re: PLease help me to make my program run

 
0
  #3
Nov 27th, 2004
I'm not sure about your compiler, but with mine, it doesn't like when you use ' in the middle of a output statement. The following lines have several...

Originally Posted by hopeolicious
MikeData << "\n\nNumber of a's: " << i_va;
MikeData << "\nNumber of e's: " << i_ve;
MikeData << "\nNumber of i's: " << i_vi;
MikeData << "\nNumber of o's: " << i_vo;
MikeData << "\nNumber of u's: " << i_vu;

$
I believe that you should use \' in place of just a plain '. Hope I could help.

Nate
Behind every great gymnast - is a mentally unstable coach.
Reply With Quote Quick reply to this message  
Join Date: Oct 2004
Posts: 43
Reputation: hopeolicious is an unknown quantity at this point 
Solved Threads: 0
hopeolicious hopeolicious is offline Offline
Light Poster

Re: PLease help me to make my program run

 
0
  #4
Nov 27th, 2004
I compile with soloris and my problem with undertermined character constant in in my function void letter but i dont see why because when i didnt have it in data files or whatever its called my program ran fine
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:


Thread Tools Search this Thread



Tag cloud for C++
About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC