Click here to Skip to main content
12,253,083 members (26,694 online)

C / C++ / MFC

 
AnswerRe: C++ vs MFC Pin
Jochen Arndt7-Oct-12 21:47
memberJochen Arndt7-Oct-12 21:47 
AnswerRe: C++ vs MFC Pin
CPallini8-Oct-12 0:08
mvpCPallini8-Oct-12 0:08 
QuestionException in IAccessibleProxyImpl from CMFCPropertyGridCtrl Pin
Bob Pryor4-Oct-12 6:50
memberBob Pryor4-Oct-12 6:50 
AnswerRe: Exception in IAccessibleProxyImpl from CMFCPropertyGridCtrl Pin
Stephen Hewitt7-Oct-12 4:59
memberStephen Hewitt7-Oct-12 4:59 
AnswerRe: Exception in IAccessibleProxyImpl from CMFCPropertyGridCtrl Pin
Bob Pryor12-Oct-12 6:30
memberBob Pryor12-Oct-12 6:30 
GeneralRe: Exception in IAccessibleProxyImpl from CMFCPropertyGridCtrl Pin
Stephen Hewitt12-Oct-12 17:17
memberStephen Hewitt12-Oct-12 17:17 
AnswerCMFCPropertyGridCtrl in a CPropertyPage (or a CMFCPropertyPage) Pin
Ursus3108-Nov-15 22:32
memberUrsus3108-Nov-15 22:32 
Questionneed code to check if the value is numeric in C Pin
Mikerush74-Oct-12 6:49
memberMikerush74-Oct-12 6:49 
I am student, taking C programming now.
I have assignment to write function to check if inputed data is numbers.   if not - it should write that, and ask to enter number again.
I wrote code, to write error message, but dont know how to make program to work on next input..   should I call the Main function again ?  

int main()
{
     
   double hours;               //hours worked in a week
   double payrate;            // hourly salary
   double grosspay;            //total weekly payment
   int k;                           //number of values read
  
printf ("Enter number of hours, and hourly pay (or press 0 to exit) \n");
     
      while ((k = scanf ("%lf%lf", &hours, &payrate))==2)
      {
     
      if (isdigit(hours) !=0)
            return hours;
            else
            printf ("You entered invalid data, please enter number of hours \n");
           
           
      if (isdigit(payrate) !=0)
            return payrate;
            else
            printf ("You entered invalid data, please enter payrate \n");
              
      if (hours==0 || payrate==0)
               {
               printf ("Good Bye. \n\n");
               system("PAUSE");
               return 0;
               }
                          
   double grosspay;
   grosspay = calculateGrossPay(hours, payrate);
     
   printf ("Hours worked: %.2f\n", hours);
   printf ("Hourly   Rate: %.2f\n\n", payrate);
   printf ("Your weekly payment is: $ %.2f \n\n\n", grosspay);
AnswerRe: need code to check if the value is numeric in C Pin
Richard MacCutchan4-Oct-12 7:22
mvpRichard MacCutchan4-Oct-12 7:22 
GeneralRe: need code to check if the value is numeric in C Pin
Mikerush74-Oct-12 7:50
memberMikerush74-Oct-12 7:50 
GeneralRe: need code to check if the value is numeric in C Pin
Richard MacCutchan4-Oct-12 7:53
mvpRichard MacCutchan4-Oct-12 7:53 
AnswerRe: need code to check if the value is numeric in C Pin
CPallini4-Oct-12 9:48
mvpCPallini4-Oct-12 9:48 
QuestionRe: need code to check if the value is numeric in C Pin
DavidCrow4-Oct-12 9:55
memberDavidCrow4-Oct-12 9:55 
AnswerRe: need code to check if the value is numeric in C Pin
Richard MacCutchan4-Oct-12 21:37
mvpRichard MacCutchan4-Oct-12 21:37 
GeneralRe: need code to check if the value is numeric in C Pin
Mikerush75-Oct-12 8:30
memberMikerush75-Oct-12 8:30 
AnswerRe: need code to check if the value is numeric in C Pin
C Mahesh8-Oct-12 22:24
memberC Mahesh8-Oct-12 22:24 
Questioni want any code to make project Pin
emanalshboul3-Oct-12 12:54
memberemanalshboul3-Oct-12 12:54 
AnswerRe: i want any code to make project Pin
Peter_in_27803-Oct-12 13:48
memberPeter_in_27803-Oct-12 13:48 
AnswerRe: i want any code to make project Pin
Mohibur Rashid3-Oct-12 18:55
memberMohibur Rashid3-Oct-12 18:55 
QuestionRe: i want any code to make project Pin
DavidCrow4-Oct-12 2:51
memberDavidCrow4-Oct-12 2:51 
AnswerRe: i want any code to make project Pin
Richard MacCutchan4-Oct-12 4:30
mvpRichard MacCutchan4-Oct-12 4:30 
Questionstatic text boxes and using the wizard to initialize a variable Pin
AndrewG12313-Oct-12 11:46
memberAndrewG12313-Oct-12 11:46 
AnswerRe: static text boxes and using the wizard to initialize a variable Pin
Mohibur Rashid3-Oct-12 18:51
memberMohibur Rashid3-Oct-12 18:51 
AnswerRe: static text boxes and using the wizard to initialize a variable Pin
«_Superman_»3-Oct-12 19:04
member«_Superman_»3-Oct-12 19:04 
AnswerRe: static text boxes and using the wizard to initialize a variable Pin
Marius Bancila4-Oct-12 0:41
memberMarius Bancila4-Oct-12 0:41 

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.


Advertise | Privacy | Mobile
Web02 | 2.8.160426.1 | Last Updated 5 May 2016
Copyright © CodeProject, 1999-2016
All Rights Reserved. Terms of Service
Layout: fixed | fluid