943,985 Members | Top Members by Rank

Ad:
  • C++ Discussion Thread
  • Unsolved
  • Views: 2788
  • C++ RSS
Nov 25th, 2004
0

PLease help me to make my program run

Expand Post »
#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
$
Similar Threads
Reputation Points: 11
Solved Threads: 0
Light Poster
hopeolicious is offline Offline
43 posts
since Oct 2004
Nov 26th, 2004
0

Re: PLease help me to make my program run

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.
Team Colleague
Reputation Points: 1658
Solved Threads: 331
duckman
jwenting is offline Offline
7,719 posts
since Nov 2004
Nov 27th, 2004
0

Re: PLease help me to make my program run

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...

Quote 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
Reputation Points: 14
Solved Threads: 1
Light Poster
Coach_Nate is offline Offline
48 posts
since Aug 2004
Nov 27th, 2004
0

Re: PLease help me to make my program run

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
Reputation Points: 11
Solved Threads: 0
Light Poster
hopeolicious is offline Offline
43 posts
since Oct 2004

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in C++ Forum Timeline: coverting a Bitmap from colour format to greyscale
Next Thread in C++ Forum Timeline: machine/assembly language, syntax error





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC