| | |
PLease help me to make my program run
Please support our C++ advertiser: Intel Parallel Studio Home
![]() |
•
•
Join Date: Oct 2004
Posts: 43
Reputation:
Solved Threads: 0
#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
$
#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
$
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.
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...
I believe that you should use \' in place of just a plain '. Hope I could help.
Nate
•
•
•
•
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;
$
Nate
Behind every great gymnast - is a mentally unstable coach.
![]() |
Similar Threads
- Make a VB Program run in the background? (VB.NET)
- How to make a screensaver run in delphi 2009 on xp/vista (Pascal and Delphi)
- how to make this program short (C++)
- VB program run in the Network (Visual Basic 4 / 5 / 6)
- Creating a program to run under various OS (Pascal and Delphi)
Other Threads in the C++ Forum
- Previous Thread: coverting a Bitmap from colour format to greyscale
- Next Thread: machine/assembly language, syntax error
| Thread Tools | Search this Thread |
Tag cloud for C++
6 add api array arrays beginner binary bmp c++ c/c++ calculator char class classes code compile compiler console conversion convert count data delete desktop directshow dll download dynamic encryption error file forms fstream function functions game givemetehcodez google graph gui iamthwee ifstream input int java lib library lines linkedlist linker loop looping loops map math matrix memory microsoft newbie news number output pointer problem program programming project python random read recursion recursive reference return sort string strings struct studio system temperature template templates test text text-file tree unix url variable vector video visual visualstudio void win32 windows winsock wordfrequency wxwidgets






