Click here to Skip to main content
15,921,169 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
Generalvalidation Pin
mpapeo3-Apr-05 23:14
mpapeo3-Apr-05 23:14 
GeneralRe: validation Pin
Gary R. Wheeler4-Apr-05 1:57
Gary R. Wheeler4-Apr-05 1:57 
GeneralRe: validation Pin
David Crow4-Apr-05 2:55
David Crow4-Apr-05 2:55 
GeneralRe: validation Pin
mpapeo4-Apr-05 7:51
mpapeo4-Apr-05 7:51 
GeneralRe: validation Pin
mpapeo4-Apr-05 10:30
mpapeo4-Apr-05 10:30 
GeneralRe: validation Pin
David Crow4-Apr-05 10:38
David Crow4-Apr-05 10:38 
GeneralRe: validation Pin
mpapeo4-Apr-05 11:01
mpapeo4-Apr-05 11:01 
GeneralRe: validation Pin
mpapeo4-Apr-05 12:01
mpapeo4-Apr-05 12:01 
Well i used the other method which i found it simpler even though longer that the one you suggested.
printf("\nEnter choice (1-4): ");<br />
	valid = 0;<br />
	while( valid == 0)<br />
   {<br />
     fgets(iobuf,sizeof(iobuf),stdin);     <br />
     len = strlen(iobuf)-1;<br />
     iobuf[len] = 0;<br />
     // validate data<br />
     valid = 1; // assume valid input<br />
     for(i = 0; i < len; i++)	//loop controlling invalid input<br />
     {<br />
         if( !isdigit(iobuf[i]))<br />
         {<br />
           printf("\nPlese enter numeric digits only (1-8):");<br />
           valid = 0;          <br />
         }<br />
      }<br />
	 break;<br />
   }<br />
   choice = atoi(iobuf);<br />
 <br />
	scanf("%d", &choice);	//scanning the iput from the keyboard<br />
	return choice; <br />
 }


Thanks anyway.

-oam-
GeneralRe: validation Pin
David Crow4-Apr-05 17:03
David Crow4-Apr-05 17:03 
GeneralRe: validation Pin
David Crow4-Apr-05 17:01
David Crow4-Apr-05 17:01 
Generalglobal variables in dynamic link library Pin
arthi_mclt3-Apr-05 23:05
arthi_mclt3-Apr-05 23:05 
GeneralRe: global variables in dynamic link library Pin
Alexander M.,4-Apr-05 2:53
Alexander M.,4-Apr-05 2:53 
GeneralText display with CHtmlView Pin
lordguid3-Apr-05 22:48
lordguid3-Apr-05 22:48 
GeneralRichEdit and Console Pin
AdyOS3-Apr-05 22:36
AdyOS3-Apr-05 22:36 
GeneralRe: RichEdit and Console Pin
toxcct3-Apr-05 22:39
toxcct3-Apr-05 22:39 
GeneralRe: RichEdit and Console Pin
AdyOS3-Apr-05 23:00
AdyOS3-Apr-05 23:00 
GeneralRe: RichEdit and Console Pin
toxcct3-Apr-05 23:22
toxcct3-Apr-05 23:22 
GeneralRe: RichEdit and Console Pin
S. Senthil Kumar3-Apr-05 23:24
S. Senthil Kumar3-Apr-05 23:24 
GeneralRe: RichEdit and Console Pin
AdyOS3-Apr-05 23:33
AdyOS3-Apr-05 23:33 
GeneralRe: RichEdit and Console Pin
AdyOS3-Apr-05 23:58
AdyOS3-Apr-05 23:58 
GeneralVxDs vs DLL Pin
Neha.marwaha3-Apr-05 22:25
Neha.marwaha3-Apr-05 22:25 
GeneralRe: VxDs vs DLL Pin
toxcct3-Apr-05 22:36
toxcct3-Apr-05 22:36 
GeneralRe: VxDs vs DLL Pin
Alexander M.,4-Apr-05 2:40
Alexander M.,4-Apr-05 2:40 
General0L Pin
LiYS3-Apr-05 21:41
LiYS3-Apr-05 21:41 
GeneralRe: 0L Pin
toxcct3-Apr-05 22:32
toxcct3-Apr-05 22:32 

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.