making a conditional statement with a string containing all possible combination of four digits in 'C' -


I have a problem collecting four digit combination (person id) using the PocketSfix C program code. All my other orders were detected and operated correctly. But I do not know how to prepare a conditional statement, which will be selected when the detection of the selected four digit combination. Please suggest how I can do this !! printf ("Processing ... \ n"); fflush (stdout); / * Finish decoding, get results and print * / ps_end_utt (ps); Hyp = ps_get_hyp (ps, NULL, and uttid); // printf ("% s:% s \ n", uttid, hyp); fflush (stdout); If (half) {sscanf (half, "% s", word); If (strcmp (hype, "leshhe fehryplan") == 0) {counter_correct = counter_correct + 1; Printf ("LASCHE FAHRPLAN is confirmed \ n"); Printf ("Count the correct number of statement, the total number of statements% s \ n", counter_correct, uttid); } And if (strcmp (Hype, "Lesch Warscau") == 0) {counter_correct = counter_correct + 1; Printf ("Lesch Vorschu is confirmed \ n"); Printf ("Calculate the correct number% of the statement, the total number of statements% s \ n", counter_correct, uttid); }

Similarly, I want to search the string '1 2 3 4', '3 7 8 9' (all possible combinations of four digits) which are also generated on variable hyff Are [printf ("% S:% s \ n", uttid, half ); ] How do I create a conditional loop for this matter?

Thank you for your help.

Use strtol () . Example of code:

  #include & lt; Stdlib.h & gt; / * Your Code * / if (Half) {sscanf (Half, "% s", word); Long interval code = Strottol (hi, faucet, 10); If (code & gt; 0 & amp; amp; amp; amp; amp; amp; code & lt; 10000) {printf ("numeric code% ld \ n", code); / * Other works * /} if (strcmp (Hype, "Leishhe Feheran") == 0) {counter_correct = counter_correct + 1; Printf ("LASCHE FAHRPLAN is confirmed \ n"); Printf ("Count the correct number of statement, the total number of statements% s \ n", counter_correct, uttid); }    

Comments

Popular posts from this blog

Pass DB Connection parameters to a Kettle a.k.a PDI table Input step dynamically from Excel -

multithreading - PhantomJS-Node in a for Loop -

c++ - MATLAB .m file to .mex file using Matlab Compiler -