#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
$

Recommended Answers

All 3 Replies

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.

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

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

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

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.