SilabGarza - RS Private Server  
Home Forum Play Register Store Market Highscores Mark Forums Read
Go Back   SilabGarza - RS Private Server > SilGar Media > Computers > Programming
Reload this Page Program


Program
Old
  (#1 (permalink))
D Kai is Offline
<span style="color: black">Dark eyes of life.</span>
image
 
D Kai's Avatar
 
Posts: 3,362
Cookies Given: 458
Cookies Received: 373
Time Online: 116 d 12 h 6 m
Clan: Imperium Owner
   
Default Program - 06-29-2014, 06:43 PM

[FONT="Tahoma"][COLOR="DarkOrchid"][SIZE="3"]
Code:
int selecao_int(){}
	int num_safe[100];
	char input;
	int i=0;
	int j=0;
	int count=0;
	int mult;
	int num;
	
	do{	
		input=0;
		if(kbhit()){
			input=getch(); //para nao parecer 2 hits ao mesmo tempo
			if(input==27){
				system("cls");
				return -1;
			} 
			if(input==8 && i!=0){
				printf("\b \b");
				num_safe[i-1]=-1;
				i--;
			}else{
				if(input==48){
					num_safe[i]=0;
					count=1;
				} //0
				if(input==49){
					num_safe[i]=1;
					count=1;
				} //1
				if(input==50){
					num_safe[i]=2;
					count=1;
				} //2
				if(input==51){
					num_safe[i]=3;
					count=1;
				} //3
				if(input==52){
					num_safe[i]=4;
					count=1;
				} //4
				if(input==53){
					num_safe[i]=5;
					count=1;
				} //5
				if(input==54){
					num_safe[i]=6;
					count=1;
				} //6
				if(input==55){
					num_safe[i]=7;
					count=1;
				} //7
				if(input==56){
					num_safe[i]=8;
					count=1;
				} //8
				if(input==57){
					num_safe[i]=9;
					count=1;
				} //9
				if(count==1){
					printf("%i",num_safe[i]);
					i++;
				}	
				count=0;	
			}
		}
	}while(input!=13);
	
	mult=1;
	for(j=i;j!=0;j--){
		num_safe[j-1]=num_safe[j-1]*mult;
		mult=mult*10;
	}
	
	num=0;
	for(j=0;j<i;j++){
		num=num + num_safe[j];	
	}
	
	//printf("\n %i num",num);
	//getch();
	return num;
}
This function is giving me fucked up errors Idk why.

Sometimes it works, others dosen't. (On Compiler)



@nater360

EDIT: It's C, tho thats not the problem.

Last edited by D Kai; 06-29-2014 at 06:46 PM.
  
Old
  (#2 (permalink))
nater360
Guest
 
nater360's Avatar
 
Posts: n/a
Time Online: N/A
   
Default 06-29-2014, 06:47 PM

"while(input!=13);"

should be

while(input!=13){
  
Old
  (#3 (permalink))
D Kai is Offline
<span style="color: black">Dark eyes of life.</span>
image
 
D Kai's Avatar
 
Posts: 3,362
Cookies Given: 458
Cookies Received: 373
Time Online: 116 d 12 h 6 m
Clan: Imperium Owner
   
Default 06-29-2014, 06:51 PM

Quote:
Originally Posted by nater360 View Post
"while(input!=13);"

should be

while(input!=13){
I am doing

do{
}while(1);

thing, but the problem thinks* its a while(1){ } ye...
  
Old
  (#4 (permalink))
nater360
Guest
 
nater360's Avatar
 
Posts: n/a
Time Online: N/A
   
Default 06-29-2014, 06:53 PM

change it to _while then?
  
Old
  (#5 (permalink))
D Kai is Offline
<span style="color: black">Dark eyes of life.</span>
image
 
D Kai's Avatar
 
Posts: 3,362
Cookies Given: 458
Cookies Received: 373
Time Online: 116 d 12 h 6 m
Clan: Imperium Owner
   
Default 06-29-2014, 06:56 PM

Quote:
Originally Posted by nater360 View Post
change it to _while then?
I will see.

Problem is that it sometimes works on compile, sometimes dosen't.

I think its the compilers problem, but ye.

Thanks for the help.
  
Old
  (#6 (permalink))
Bart Simpson is Offline
Senior Member
image
 
Bart Simpson's Avatar
 
Posts: 2,050
Cookies Given: 82
Cookies Received: 147
Time Online: 38 d 8 h 48 m
   
Default 06-30-2014, 12:27 AM

Wow A+


#1
  
adsense code2.3
Closed Thread

Bookmarks

Program

Programming




Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
adsense2.6
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT -7. The time now is 12:00 AM.





Powered by vBulletin® Version 3.8.8
Copyright ©2000 - 2017, vBulletin Solutions, Inc.