- Strength to Increase Rep
- +3
- Strength to Decrease Rep
- -0
- Upvotes Received
- 1
- Posts with Upvotes
- 1
- Upvoting Members
- 1
- Downvotes Received
- 1
- Posts with Downvotes
- 1
- Downvoting Members
- 1
student
- Interests
- I am a complete sportsman..i love playing (and watching too)all kinds of sports ranging from football,basketball…
- PC Specs
- Microsoft XP home edition--sp2 Pentium 4 --2.40 GHz, 512 MB RAM, 80 GB hard drive.
i have been using CreatProcess in my program to initialize another program with two command line arguments as C:\\Documents and Settings\\xyz.exe and 2 so the code i am using is [code=c] CreateProcess ( "C:\\abc.exe", " C:\\Documents and Settings\\xyz.exe 2", NULL, NULL, FALSE, NORMAL_PRIORITY_CLASS, NULL, NULL, &si, &pi ); [/code] but … | |
hey...i want to understand how following code works : [code=c]int x=1; printf("%d%d%d",x,++x,x); [/code] [code]OUTPUT: 222[/code] also [code=c]int x=1; printf("%d%d%d",x,++x,x++); [/code] [code]OUTPUT: 221[/code] actually these o/p are produced when i use [B]visual c++[/B] compiler but when i wrote the same commands in [B]turbo c[/B] they gave perfectly understandable o/p as [B]221[/B] … | |
Re: [code=c] float x; scanf("%d",&x); [/code] x is a float value so in the scanf statement u should use %f instead of %d. .....cheers | |
Re: i think u might use the getch() putch combination use getch to enter the charcter one by one and then using putch print out * example: [code=c] getch(password[x]); //where x runs in a loop from 0 till NULL putch('*'); [/code] PS:go through this thread [code][url]http://www.daniweb.com/forums/thread9916.html[/url][/code] has a better detailed solution.... | |
Re: [QUOTE=henks;724022][code] #include<stdio.h> #include<stdlib.h> #include<string.h> #include<math.h> int main(){ char input[10]; int i,j,digit,out[10],flag=0,sum; while(flag==0){ sum=0; flag=0; strcpy(input," "); scanf("%s",&input); fflush(stdin); digit=strlen(input); printf("%d\n",flag); if(strlen(input)>8){break;} /*else { for(i=0;i<8;i++){ if (input[i]!=48&&input[i]!=49){ flag++; break; } } }*/ printf("%d\n",digit); printf("%d",flag); if (flag==1){break;} for(i=0;i<8;i++){ if(input[i]!='\0'){ if(input[i]=='1'){ out[i]=1;} else if(input[i]=='0'){ out[i]=0;} } } j=1; for(i=0;i<digit;i++){ sum+=out[i]*pow(2,digit-j); j++; } printf("Decimal … | |
Re: [code=c] void main() { int sec_code=0; do { scanf("%d",&sec_code); }while((sec_code<1||sec_code>4)&&printf("invalid section code")); } [/code] Try this code works perfectly for me.... |