Click here to Skip to main content
15,887,135 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
SuggestionRe: CMap class questions Pin
Richard MacCutchan5-Mar-14 3:13
mveRichard MacCutchan5-Mar-14 3:13 
GeneralRe: CMap class questions Pin
econy5-Mar-14 3:44
econy5-Mar-14 3:44 
GeneralRe: CMap class questions Pin
Richard MacCutchan5-Mar-14 4:37
mveRichard MacCutchan5-Mar-14 4:37 
GeneralRe: CMap class questions Pin
econy5-Mar-14 4:07
econy5-Mar-14 4:07 
GeneralRe: CMap class questions Pin
Richard MacCutchan5-Mar-14 4:39
mveRichard MacCutchan5-Mar-14 4:39 
Questionif/else, expression can not be used as a function. C program Pin
cstudent14-Mar-14 20:37
cstudent14-Mar-14 20:37 
AnswerRe: if/else, expression can not be used as a function. C program Pin
Jochen Arndt4-Mar-14 21:12
professionalJochen Arndt4-Mar-14 21:12 
GeneralRe: if/else, expression can not be used as a function. C program Pin
cstudent15-Mar-14 7:14
cstudent15-Mar-14 7:14 
Thanks, I am trying to implement your suggestions here is what I currently have..

#include <stdio.h>
#define MAXCOUNT 10

int main ()
{
int opselect;
int day, month;

printf("Enter a month between 1-12 :");
scanf("%d", &month);
printf("Enter a number for the day of the month");
scanf("%d", &day);
scanf("%d", &opselect);

switch (opselect) {

case 1:
if (month==2 && (day < 1 || > 28))
{printf("\nEnter a day between 1 and 28: \n ");
scanf("%d",&day);
}

case 2:
else if (month==4 || month==6 || month==9 || month==11)&&(day < 1 || day > 30))
{printf("\nEnter a day between 1 and 30: \n ");
scanf("%d",&day);
}

case 3:
else if (month==3 || month==5 || month==7 || month==10 || month==12)&&(day < 1 || day > 31))
{printf("\nEnter a day between 1 and 31: \n ");
scanf("%d",&day);
}

printf("The day accepted is %d\n",day);

return 0;
}

I am getting a ton of errors here, expected primary-expression before else, expected; before else.

What I am trying to do is based on the month input prompt for a the proper number of days in the month(2=28, 1=31 etc)and get in error message if you enter the wrong days(29 in Feb for example)
GeneralRe: if/else, expression can not be used as a function. C program Pin
Jochen Arndt5-Mar-14 7:40
professionalJochen Arndt5-Mar-14 7:40 
GeneralRe: if/else, expression can not be used as a function. C program Pin
cstudent15-Mar-14 7:58
cstudent15-Mar-14 7:58 
GeneralRe: if/else, expression can not be used as a function. C program Pin
cstudent15-Mar-14 8:03
cstudent15-Mar-14 8:03 
GeneralRe: if/else, expression can not be used as a function. C program Pin
Trace199524-Mar-14 15:16
Trace199524-Mar-14 15:16 
QuestionSend global Touch event Pin
cedricvictor4-Mar-14 18:42
cedricvictor4-Mar-14 18:42 
QuestionSpeed up a square root c++ prog Pin
Craig McRae4-Mar-14 9:00
Craig McRae4-Mar-14 9:00 
AnswerRe: Speed up a square root c++ prog Pin
Chris Losinger4-Mar-14 9:56
professionalChris Losinger4-Mar-14 9:56 
AnswerRe: Speed up a square root c++ prog Pin
jeron14-Mar-14 9:58
jeron14-Mar-14 9:58 
AnswerRe: Speed up a square root c++ prog Pin
leon de boer4-Mar-14 13:34
leon de boer4-Mar-14 13:34 
Questionhow to convert word file in to xml using c/c++ Pin
krishnaprasad t3-Mar-14 21:53
krishnaprasad t3-Mar-14 21:53 
AnswerRe: how to convert word file in to xml using c/c++ Pin
Richard MacCutchan3-Mar-14 22:04
mveRichard MacCutchan3-Mar-14 22:04 
GeneralRe: how to convert word file in to xml using c/c++ Pin
krishnaprasad t3-Mar-14 23:58
krishnaprasad t3-Mar-14 23:58 
GeneralRe: how to convert word file in to xml using c/c++ Pin
Richard MacCutchan4-Mar-14 2:00
mveRichard MacCutchan4-Mar-14 2:00 
GeneralRe: how to convert word file in to xml using c/c++ Pin
krishnaprasad t4-Mar-14 2:33
krishnaprasad t4-Mar-14 2:33 
GeneralRe: how to convert word file in to xml using c/c++ Pin
Richard MacCutchan4-Mar-14 2:49
mveRichard MacCutchan4-Mar-14 2:49 
GeneralRe: how to convert word file in to xml using c/c++ Pin
krishnaprasad t4-Mar-14 20:13
krishnaprasad t4-Mar-14 20:13 
GeneralRe: how to convert word file in to xml using c/c++ Pin
Richard MacCutchan4-Mar-14 22:26
mveRichard MacCutchan4-Mar-14 22:26 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.