473,385 Members | 1,655 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

C++ missing terminating character and int main function error

I am suppose to make a program that when the user is asked "Enter a Letter for the day:" if the user enters M or m then the screen will output "The day of the week is Monday" and so on until Sunday. I looked over my code and everything looks right but I still get errors saying Missing terminating character " and int function main error. Can you please tell me what I did wrong.

Expand|Select|Wrap|Line Numbers
  1.  
  2. #include <iostream>
  3.  
  4. using namespace std;
  5.  
  6. int main()
  7.  
  8. {
  9.  
  10.  
  11.  
  12.     char day;
  13.  
  14.     cout << "Enter a letter for a day of the week: ";
  15.     cin >> day;
  16.     cout << endl;
  17.  
  18.     cout << "The letter you entered is " << day 
  19.          << endl;
  20.  
  21.  
  22.     switch(day)
  23.  
  24.     {
  25.  
  26.      case 'M':
  27.     case 'm':
  28.     cout << "The day of the week is Monday." << endl;
  29.     break;
  30.  
  31.     case 'T':
  32.     case 't':
  33.     cout << "The day of the week is Tuesday." << endl;
  34.     break;
  35.  
  36.     case 'W':
  37.     case 'w':
  38.     cout << "The day of the week is Wednesday." << endl;
  39.     break;
  40.  
  41.     case 'R':
  42.     case 'r':
  43.     cout << "The day of the week is Thursday." << endl;
  44.     break;
  45.  
  46.     case 'F':
  47.     case 'f':
  48.     cout << "The day of the week is Friday" << endl;
  49.     break;
  50.  
  51.     case 'S':
  52.     case 's':
  53.     cout << "The day of the week is Saturday" << endl;
  54.     break;
  55.  
  56.     case 'U':    
  57.     case 'u':
  58.     cout << "The day of the week is Sunday." << endl;
  59.     break;
  60.  
  61.     default:
  62.     cout << "You have entered an invalid letter; program aborting.” << endl;    
  63.  
  64.     }
  65.  
  66.     return 0;
  67.  
  68. }
  69.  
Oct 6 '14 #1
1 6362
donbock
2,426 Expert 2GB
The close quote on line 62 angles down-and-to-the-left. The quote character in C/C++ angles straight-down. Perhaps you used a word processor to write your program.
Oct 6 '14 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

2
by: Sonoman | last post by:
Hi all: I am getting a "missing storage class or idetifier" error and I do not understand what it means, therefore and I cannot figure it out. I am just starting a new project and I cannot get...
3
by: Patrick Hatcher | last post by:
Trying to create a plperl function to strip non-friendly mainframe characters from a string. However, when I try to add the Trademark symbol (â„¢) as a replace criteria, PG spits back an error:...
1
by: wayne.denier | last post by:
Ran across this well documented, nice looking library for C++ gaming called Amaltheia ( http://home.gna.org/amaltheia/ ), but they don't have a community :P. I'm not sure if anybody has used it...
1
by: joe10001 | last post by:
Hi all, I just installed CRELoaded (oscommerce fork) on my server and all work fine except that I have a little message at the bottom of the main page : Fatal error: main() : Security alert:...
19
by: beliavsky | last post by:
I think I read a suggestion somewhere to wrap the code where a Python script starts in a main() function, so one has def main(): print "hi" main() instead of
28
by: ravi | last post by:
Hello everybody, I am writing a small application which does some work before the user main function starts execution. I am trying to #define the main function. But the problem is that,
11
by: aarklon | last post by:
Hi all, I have heard many discussions among my colleagues that main is a user defined function or not. arguments in favour:- 1) if it is built in function it must be defined in some header...
2
by: Samant.Trupti | last post by:
Hi, Does main function support unicode? int main( int argc, char** argv ) can I say int mainw( int argc, wchar_t** argv )? Thanks Trupti
6
by: Soorali | last post by:
Hi I am a newbie to VC++ and this is my first independent project so please pardon my ignorance!! My project compiles and runs perfectly fine in Debug mode. However, when I try to compile it...
4
by: Soko San | last post by:
Sorry for bothering :( but another error happened when I tried to write the main function. It says : error C2228: left of '.getLoadFactor' must have class/struct/union type Not calling loadfactor...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.