![]() |
| Forums | Gaming News | Videos | Downloads | Today's Posts | Mark Forums Read | Chat | FAQ | Members List | Contact |
| ||||||
This is a discussion on C++ code within the PSP Development Forum forums, part of the PSP Development, Hacks, and Homebrew category; I am trying to make a simple calculator and it wont #include <stdlib.h> #include <iostream> using namespace std; int mult ...
![]() |
|
|
LinkBack | Thread Tools |
|
|
#1 |
![]() Join Date: Feb 2006
Location: www.ultimatetalkforums.com Games, RPG, quickchat and more!
Posts: 531
Trader Feedback: 0
|
I am trying to make a simple calculator and it wont
#include <stdlib.h> #include <iostream> using namespace std; int mult ( int x, int y ); int main() { int x; int y; int calc; int a; int b; cout<<"Please choose which calculator function you would like to use: \n 1.Multiplication\n 2.Addition\n 3.Subtraction\n 4.Division\n"; cin>> calc; cin.ignore(); if ( calc == 1 ) cout<<"Please insert any two numbers to be multiplied together: "; cin>> x >> y; cin.ignore(); cout<<"The product of your two numbers is "<< mult ( x, y ) <<"\n"; cin.get(); } int mult ( int x, int y ) { return x * y; } else if ( calc == 2 ) cout<<"Please insert two numbers. The second will be subtracted from the first: "; cin>> a >> b; cin.ignore(); cout<<"The number"<< ( a ) <<"minus"<< ( b ) <<"is"<< subt ( a,b ) <<"\n; cin.get(); } that is my code i think there is something wrong in this area else if ( calc == 2 ) cout<<"Please insert two numbers. The second will be subtracted from the first: "; cin>> a >> b; cin.ignore(); cout<<"The number"<< ( a ) <<"minus"<< ( b ) <<"is"<< subt ( a,b ) <<"\n; cin.get(); please tell me what is wrong i spent a long time on this code.
__________________
[CENTER][COLOR=black][COLOR=black][URL="http://forums.qj.net/f-psp-firmware-discussion-253/t-psp-firmware-30-get-it-58053.html"][COLOR=cyan]would you upgrade?[/COLOR][/URL] [/COLOR][FONT=Times New Roman][COLOR=navy][URL="http://www.mindistortion.net/iwantyoursoul/?i_am=altunozara"]OMG ITS REAL![/URL][/COLOR][/FONT][COLOR=black] [URL="http://forums.qj.net/showthread.php?t=61756&page=1&pp=10"][COLOR=lime]Sony vs Nintendo[/COLOR][/URL][/COLOR][/COLOR][/CENTER] [CENTER] [/CENTER] [CENTER][URL="http://www.ultimatetalkforums.com"][IMG]http://i94.photobucket.com/albums/l82/Altunozara/userbar2.jpg[/IMG][/URL][/CENTER] [CENTER][SIZE=3]i [/SIZE][URL="http://forums.qj.net/www.gamingwell.com"][SIZE=3]wonder what could be under this hyperlink..hmm[/SIZE][/URL][/CENTER] [CENTER][SIZE=3][COLOR=green][B][I]Maniakc is awsome!!![/I][/B][/COLOR][/SIZE][/CENTER] [CENTER][FONT=Arial Black][SIZE=3][COLOR=#660099][I][U][URL="http://forums.qj.net/member.php?u=58299"]The Brain Pwns!!![/URL][/U][/I][/COLOR][/SIZE][/FONT][/CENTER] [COLOR=sienna]Creator of:[/COLOR][URL="http://forums.qj.net/f-psp-development-forum-11/t-release-go-go-go-beta-66652.html"][COLOR=sienna]GO GO GO![/COLOR][/URL] |
|
|
|
|
|
#3 |
![]() Join Date: Feb 2006
Location: www.ultimatetalkforums.com Games, RPG, quickchat and more!
Posts: 531
Trader Feedback: 0
|
hmm how do i do that....
int subt ( int a, int b ); ? and i get an error when trying top compile the code above it puts this like in red else if ( calc == 2 ) and has this error "expected unqualified-id before "else"
__________________
[CENTER][COLOR=black][COLOR=black][URL="http://forums.qj.net/f-psp-firmware-discussion-253/t-psp-firmware-30-get-it-58053.html"][COLOR=cyan]would you upgrade?[/COLOR][/URL] [/COLOR][FONT=Times New Roman][COLOR=navy][URL="http://www.mindistortion.net/iwantyoursoul/?i_am=altunozara"]OMG ITS REAL![/URL][/COLOR][/FONT][COLOR=black] [URL="http://forums.qj.net/showthread.php?t=61756&page=1&pp=10"][COLOR=lime]Sony vs Nintendo[/COLOR][/URL][/COLOR][/COLOR][/CENTER] [CENTER] [/CENTER] [CENTER][URL="http://www.ultimatetalkforums.com"][IMG]http://i94.photobucket.com/albums/l82/Altunozara/userbar2.jpg[/IMG][/URL][/CENTER] [CENTER][SIZE=3]i [/SIZE][URL="http://forums.qj.net/www.gamingwell.com"][SIZE=3]wonder what could be under this hyperlink..hmm[/SIZE][/URL][/CENTER] [CENTER][SIZE=3][COLOR=green][B][I]Maniakc is awsome!!![/I][/B][/COLOR][/SIZE][/CENTER] [CENTER][FONT=Arial Black][SIZE=3][COLOR=#660099][I][U][URL="http://forums.qj.net/member.php?u=58299"]The Brain Pwns!!![/URL][/U][/I][/COLOR][/SIZE][/FONT][/CENTER] [COLOR=sienna]Creator of:[/COLOR][URL="http://forums.qj.net/f-psp-development-forum-11/t-release-go-go-go-beta-66652.html"][COLOR=sienna]GO GO GO![/COLOR][/URL] |
|
|
|
|
|
#4 |
![]() |
oh.
wow. Amazed I didn't see it before Code:
int main()
{
int x;
int y;
int calc;
int a;
int b;
cout<<"Please choose which calculator function you would like to use: \n 1.Multiplication\n 2.Addition\n 3.Subtraction\n 4.Division\n";
cin>> calc;
cin.ignore();
if ( calc == 1 )
cout<<"Please insert any two numbers to be multiplied together: ";
cin>> x >> y;
cin.ignore();
cout<<"The product of your two numbers is "<< mult ( x, y ) <<"\n";
cin.get();
}
int mult ( int x, int y )
{
return x * y;
}
else if ( calc == 2 )
cout<<"Please insert two numbers. The second will be subtracted from the first: ";
cin>> a >> b;
cin.ignore();
cout<<"The number"<< ( a ) <<"minus"<< ( b ) <<"is"<< subt ( a,b ) <<"\n;
cin.get();
}
2. You ended your 'main' function without a return value. 3. You used 'subt' but never made any *code* for it. 4. You attempted to embed 'mult' in 'main'. You... should never do that. Ever. 5. You've got unnecessary extra variables. If your code's flow never uses the same variable twice to get input, just use the same variable in every flow path (i.e. if it's used in the 'if' and 'else' parts of an 'if' statement, use the same variable to get input in both). Code:
#include <iostream>
using namespace std;
int mult ( int x, int y );
int subt ( int x, int y ); // definition!!
int main()
{
int x;
int y;
int calc;
cout<<"Please choose which calculator function you would like to use: \n 1.Multiplication\n 2.Addition\n 3.Subtraction\n 4.Division\n";
cin>> calc;
cin.ignore();
if ( calc == 1 ) { // bracket!!
cout<<"Please insert any two numbers to be multiplied together: ";
cin>> x >> y;
cin.ignore();
cout<<"The product of your two numbers is "<< mult ( x, y ) <<"\n";
cin.get();
}
else if ( calc == 2 ) { // bracket!!
cout<<"Please insert two numbers. The second will be subtracted from the first: ";
cin>> x >> y;
cin.ignore();
cout<<"The number"<< ( x ) <<"minus"<< ( y ) <<"is"<< subt ( x,y ) <<"\n;
cin.get();
}
int mult ( int x, int y )
{
return x * y;
}
int subt ( int x, int y ) // code!!
{
return x - y;
}
__________________
[qj now fails.] |
|
|
|
|
|
#5 |
![]() Join Date: Feb 2006
Location: www.ultimatetalkforums.com Games, RPG, quickchat and more!
Posts: 531
Trader Feedback: 0
|
#include <iostream>
using namespace std; int mult ( int x, int y ); int subt ( int x, int y ); // definition!! int main() { int x; int y; int calc; cout<<"Please choose which calculator function you would like to use: \n 1.Multiplication\n 2.Addition\n 3.Subtraction\n 4.Division\n"; cin>> calc; cin.ignore(); if ( calc == 1 ) { // bracket!! cout<<"Please insert any two numbers to be multiplied together: "; cin>> x >> y; cin.ignore(); cout<<"The product of your two numbers is "<< mult ( x, y ) <<"\n"; cin.get(); } else if ( calc == 2 ) { // bracket!! cout<<"Please insert two numbers. The second will be subtracted from the first: "; cin>> x >> y; cin.ignore(); cout<<"The number"<< ( x ) <<"minus"<< ( y ) <<"is"<< subt ( x, y ) <<"\n"; cin.get(); } int mult ( int x, int y ) { return x * y; } int subt ( int x, int y ) // code!! { return x - y; }__________________ but now theres an error on the line i did in bold it comes with this error "a function-definition is not allowed here before '{' token"
__________________
[CENTER][COLOR=black][COLOR=black][URL="http://forums.qj.net/f-psp-firmware-discussion-253/t-psp-firmware-30-get-it-58053.html"][COLOR=cyan]would you upgrade?[/COLOR][/URL] [/COLOR][FONT=Times New Roman][COLOR=navy][URL="http://www.mindistortion.net/iwantyoursoul/?i_am=altunozara"]OMG ITS REAL![/URL][/COLOR][/FONT][COLOR=black] [URL="http://forums.qj.net/showthread.php?t=61756&page=1&pp=10"][COLOR=lime]Sony vs Nintendo[/COLOR][/URL][/COLOR][/COLOR][/CENTER] [CENTER] [/CENTER] [CENTER][URL="http://www.ultimatetalkforums.com"][IMG]http://i94.photobucket.com/albums/l82/Altunozara/userbar2.jpg[/IMG][/URL][/CENTER] [CENTER][SIZE=3]i [/SIZE][URL="http://forums.qj.net/www.gamingwell.com"][SIZE=3]wonder what could be under this hyperlink..hmm[/SIZE][/URL][/CENTER] [CENTER][SIZE=3][COLOR=green][B][I]Maniakc is awsome!!![/I][/B][/COLOR][/SIZE][/CENTER] [CENTER][FONT=Arial Black][SIZE=3][COLOR=#660099][I][U][URL="http://forums.qj.net/member.php?u=58299"]The Brain Pwns!!![/URL][/U][/I][/COLOR][/SIZE][/FONT][/CENTER] [COLOR=sienna]Creator of:[/COLOR][URL="http://forums.qj.net/f-psp-development-forum-11/t-release-go-go-go-beta-66652.html"][COLOR=sienna]GO GO GO![/COLOR][/URL] |
|
|
|
|
|
#7 |
![]() Join Date: Feb 2006
Location: www.ultimatetalkforums.com Games, RPG, quickchat and more!
Posts: 531
Trader Feedback: 0
|
Please just tell me how to fix it
__________________
[CENTER][COLOR=black][COLOR=black][URL="http://forums.qj.net/f-psp-firmware-discussion-253/t-psp-firmware-30-get-it-58053.html"][COLOR=cyan]would you upgrade?[/COLOR][/URL] [/COLOR][FONT=Times New Roman][COLOR=navy][URL="http://www.mindistortion.net/iwantyoursoul/?i_am=altunozara"]OMG ITS REAL![/URL][/COLOR][/FONT][COLOR=black] [URL="http://forums.qj.net/showthread.php?t=61756&page=1&pp=10"][COLOR=lime]Sony vs Nintendo[/COLOR][/URL][/COLOR][/COLOR][/CENTER] [CENTER] [/CENTER] [CENTER][URL="http://www.ultimatetalkforums.com"][IMG]http://i94.photobucket.com/albums/l82/Altunozara/userbar2.jpg[/IMG][/URL][/CENTER] [CENTER][SIZE=3]i [/SIZE][URL="http://forums.qj.net/www.gamingwell.com"][SIZE=3]wonder what could be under this hyperlink..hmm[/SIZE][/URL][/CENTER] [CENTER][SIZE=3][COLOR=green][B][I]Maniakc is awsome!!![/I][/B][/COLOR][/SIZE][/CENTER] [CENTER][FONT=Arial Black][SIZE=3][COLOR=#660099][I][U][URL="http://forums.qj.net/member.php?u=58299"]The Brain Pwns!!![/URL][/U][/I][/COLOR][/SIZE][/FONT][/CENTER] [COLOR=sienna]Creator of:[/COLOR][URL="http://forums.qj.net/f-psp-development-forum-11/t-release-go-go-go-beta-66652.html"][COLOR=sienna]GO GO GO![/COLOR][/URL] |
|
|
|
|
|
#10 |
![]() Join Date: Feb 2006
Location: www.ultimatetalkforums.com Games, RPG, quickchat and more!
Posts: 531
Trader Feedback: 0
|
ty but how comke theres that error
__________________
[CENTER][COLOR=black][COLOR=black][URL="http://forums.qj.net/f-psp-firmware-discussion-253/t-psp-firmware-30-get-it-58053.html"][COLOR=cyan]would you upgrade?[/COLOR][/URL] [/COLOR][FONT=Times New Roman][COLOR=navy][URL="http://www.mindistortion.net/iwantyoursoul/?i_am=altunozara"]OMG ITS REAL![/URL][/COLOR][/FONT][COLOR=black] [URL="http://forums.qj.net/showthread.php?t=61756&page=1&pp=10"][COLOR=lime]Sony vs Nintendo[/COLOR][/URL][/COLOR][/COLOR][/CENTER] [CENTER] [/CENTER] [CENTER][URL="http://www.ultimatetalkforums.com"][IMG]http://i94.photobucket.com/albums/l82/Altunozara/userbar2.jpg[/IMG][/URL][/CENTER] [CENTER][SIZE=3]i [/SIZE][URL="http://forums.qj.net/www.gamingwell.com"][SIZE=3]wonder what could be under this hyperlink..hmm[/SIZE][/URL][/CENTER] [CENTER][SIZE=3][COLOR=green][B][I]Maniakc is awsome!!![/I][/B][/COLOR][/SIZE][/CENTER] [CENTER][FONT=Arial Black][SIZE=3][COLOR=#660099][I][U][URL="http://forums.qj.net/member.php?u=58299"]The Brain Pwns!!![/URL][/U][/I][/COLOR][/SIZE][/FONT][/CENTER] [COLOR=sienna]Creator of:[/COLOR][URL="http://forums.qj.net/f-psp-development-forum-11/t-release-go-go-go-beta-66652.html"][COLOR=sienna]GO GO GO![/COLOR][/URL] |
|
|
|
|
|
#11 |
![]() |
Look at my code. It seems simpler than yours.
Spoiler for My code:
__________________
[U][URL="http://www.speedtest.net"][/URL][URL="http://www.speedtest.net/"][IMG]http://img459.imageshack.us/img459/5021/darkhuntercopyrz9jx4.png[/IMG][/URL][/U] |
|
|
|
|
|
#12 |
![]() Join Date: Feb 2006
Location: www.ultimatetalkforums.com Games, RPG, quickchat and more!
Posts: 531
Trader Feedback: 0
|
OMFG I FIXED IT! ON YM OWN! i read the error and it said something about it being in main and i thaught i should maybe put in another } to end the main...it worked!
-= Double Post =- yeh but i dont get how that code works...
__________________
[CENTER][COLOR=black][COLOR=black][URL="http://forums.qj.net/f-psp-firmware-discussion-253/t-psp-firmware-30-get-it-58053.html"][COLOR=cyan]would you upgrade?[/COLOR][/URL] [/COLOR][FONT=Times New Roman][COLOR=navy][URL="http://www.mindistortion.net/iwantyoursoul/?i_am=altunozara"]OMG ITS REAL![/URL][/COLOR][/FONT][COLOR=black] [URL="http://forums.qj.net/showthread.php?t=61756&page=1&pp=10"][COLOR=lime]Sony vs Nintendo[/COLOR][/URL][/COLOR][/COLOR][/CENTER] [CENTER] [/CENTER] [CENTER][URL="http://www.ultimatetalkforums.com"][IMG]http://i94.photobucket.com/albums/l82/Altunozara/userbar2.jpg[/IMG][/URL][/CENTER] [CENTER][SIZE=3]i [/SIZE][URL="http://forums.qj.net/www.gamingwell.com"][SIZE=3]wonder what could be under this hyperlink..hmm[/SIZE][/URL][/CENTER] [CENTER][SIZE=3][COLOR=green][B][I]Maniakc is awsome!!![/I][/B][/COLOR][/SIZE][/CENTER] [CENTER][FONT=Arial Black][SIZE=3][COLOR=#660099][I][U][URL="http://forums.qj.net/member.php?u=58299"]The Brain Pwns!!![/URL][/U][/I][/COLOR][/SIZE][/FONT][/CENTER] [COLOR=sienna]Creator of:[/COLOR][URL="http://forums.qj.net/f-psp-development-forum-11/t-release-go-go-go-beta-66652.html"][COLOR=sienna]GO GO GO![/COLOR][/URL] Last edited by altunozara; 07-11-2007 at 07:54 AM.. Reason: Automerged Doublepost |
|
|
|
|
|
#13 |
![]() ![]() sceKernelExitGame();
|
you forgot your closing bracket for the main function.
Code:
int main()
{ // bracket!!
int x;
int y;
int calc;
cout<<"Please choose which calculator function you would like to use: \n 1.Multiplication\n 2.Addition\n 3.Subtraction\n 4.Division\n";
cin>> calc;
cin.ignore();
if ( calc == 1 )
{ // bracket!!
cout<<"Please insert any two numbers to be multiplied together: ";
cin>> x >> y;
cin.ignore();
cout<<"The product of your two numbers is "<< mult ( x, y ) <<"\n";
cin.get();
} // closing bracket!!
else if ( calc == 2 )
{ // bracket!!
cout<<"Please insert two numbers. The second will be subtracted from the first: ";
cin>> x >> y;
cin.ignore();
cout<<"The number"<< ( x ) <<"minus"<< ( y ) <<"is"<< subt ( x,y ) <<"\n";
cin.get();
} // closing bracket!!
} // closing bracket!! This is what you forgot
int mult ( int x, int y )
{
return x * y;
}
int subt ( int x, int y ) // code!!
{
return x - y;
}
Edit - seemed you fixed it... BTW, the indentation on these forums are really big!
__________________
|
|
|
|
|
|
#14 |
![]() Join Date: Feb 2006
Location: www.ultimatetalkforums.com Games, RPG, quickchat and more!
Posts: 531
Trader Feedback: 0
|
WOOH! Ive done addition subtraction multiplication and division!
except ...once you choose which..and enter the numbers it tells you but you vcant enter more in... how can i make it loop something...
__________________
[CENTER][COLOR=black][COLOR=black][URL="http://forums.qj.net/f-psp-firmware-discussion-253/t-psp-firmware-30-get-it-58053.html"][COLOR=cyan]would you upgrade?[/COLOR][/URL] [/COLOR][FONT=Times New Roman][COLOR=navy][URL="http://www.mindistortion.net/iwantyoursoul/?i_am=altunozara"]OMG ITS REAL![/URL][/COLOR][/FONT][COLOR=black] [URL="http://forums.qj.net/showthread.php?t=61756&page=1&pp=10"][COLOR=lime]Sony vs Nintendo[/COLOR][/URL][/COLOR][/COLOR][/CENTER] [CENTER] [/CENTER] [CENTER][URL="http://www.ultimatetalkforums.com"][IMG]http://i94.photobucket.com/albums/l82/Altunozara/userbar2.jpg[/IMG][/URL][/CENTER] [CENTER][SIZE=3]i [/SIZE][URL="http://forums.qj.net/www.gamingwell.com"][SIZE=3]wonder what could be under this hyperlink..hmm[/SIZE][/URL][/CENTER] [CENTER][SIZE=3][COLOR=green][B][I]Maniakc is awsome!!![/I][/B][/COLOR][/SIZE][/CENTER] [CENTER][FONT=Arial Black][SIZE=3][COLOR=#660099][I][U][URL="http://forums.qj.net/member.php?u=58299"]The Brain Pwns!!![/URL][/U][/I][/COLOR][/SIZE][/FONT][/CENTER] [COLOR=sienna]Creator of:[/COLOR][URL="http://forums.qj.net/f-psp-development-forum-11/t-release-go-go-go-beta-66652.html"][COLOR=sienna]GO GO GO![/COLOR][/URL] |
|
|
|
|
|
#16 |
![]() Join Date: Feb 2006
Location: www.ultimatetalkforums.com Games, RPG, quickchat and more!
Posts: 531
Trader Feedback: 0
|
hmmm is there a way to make it so like once youve entered the two numbers it goes back to the choose your option of which calc type and then you enter again and it goes back again...? ive tried while and do.. while
__________________
[CENTER][COLOR=black][COLOR=black][URL="http://forums.qj.net/f-psp-firmware-discussion-253/t-psp-firmware-30-get-it-58053.html"][COLOR=cyan]would you upgrade?[/COLOR][/URL] [/COLOR][FONT=Times New Roman][COLOR=navy][URL="http://www.mindistortion.net/iwantyoursoul/?i_am=altunozara"]OMG ITS REAL![/URL][/COLOR][/FONT][COLOR=black] [URL="http://forums.qj.net/showthread.php?t=61756&page=1&pp=10"][COLOR=lime]Sony vs Nintendo[/COLOR][/URL][/COLOR][/COLOR][/CENTER] [CENTER] [/CENTER] [CENTER][URL="http://www.ultimatetalkforums.com"][IMG]http://i94.photobucket.com/albums/l82/Altunozara/userbar2.jpg[/IMG][/URL][/CENTER] [CENTER][SIZE=3]i [/SIZE][URL="http://forums.qj.net/www.gamingwell.com"][SIZE=3]wonder what could be under this hyperlink..hmm[/SIZE][/URL][/CENTER] [CENTER][SIZE=3][COLOR=green][B][I]Maniakc is awsome!!![/I][/B][/COLOR][/SIZE][/CENTER] [CENTER][FONT=Arial Black][SIZE=3][COLOR=#660099][I][U][URL="http://forums.qj.net/member.php?u=58299"]The Brain Pwns!!![/URL][/U][/I][/COLOR][/SIZE][/FONT][/CENTER] [COLOR=sienna]Creator of:[/COLOR][URL="http://forums.qj.net/f-psp-development-forum-11/t-release-go-go-go-beta-66652.html"][COLOR=sienna]GO GO GO![/COLOR][/URL] |
|
|
|
|
|
#18 |
![]() Join Date: Feb 2006
Location: www.ultimatetalkforums.com Games, RPG, quickchat and more!
Posts: 531
Trader Feedback: 0
|
i did this
#include <stdlib.h> #include <iostream> using namespace std; int mult ( int x, int y ); int addi ( int x, int y ); int subt ( int x, int y ); int divi ( int x, int y ); int main() { // bracket!! int x; int y; int calc; int restart; do { cout<<"Please choose which calculator function you would like to use: \n 1.Multiplication\n 2.Addition\n 3.Subtraction\n 4.Division\n"; cin>> calc; cin.ignore(); } while if ( calc == 1 ) { // bracket!! cout<<"Please insert any two numbers to be multiplied together: "; cin>> x >> y; cin.ignore(); cout<<"The product of your two numbers is "<< mult ( x, y ) <<"\n"; cin.get(); } // closing bracket!! but now i dont know how to make the while do something that says when you choose an option and it gives you the answer it will go and do the "do" any help?
__________________
[CENTER][COLOR=black][COLOR=black][URL="http://forums.qj.net/f-psp-firmware-discussion-253/t-psp-firmware-30-get-it-58053.html"][COLOR=cyan]would you upgrade?[/COLOR][/URL] [/COLOR][FONT=Times New Roman][COLOR=navy][URL="http://www.mindistortion.net/iwantyoursoul/?i_am=altunozara"]OMG ITS REAL![/URL][/COLOR][/FONT][COLOR=black] [URL="http://forums.qj.net/showthread.php?t=61756&page=1&pp=10"][COLOR=lime]Sony vs Nintendo[/COLOR][/URL][/COLOR][/COLOR][/CENTER] [CENTER] [/CENTER] [CENTER][URL="http://www.ultimatetalkforums.com"][IMG]http://i94.photobucket.com/albums/l82/Altunozara/userbar2.jpg[/IMG][/URL][/CENTER] [CENTER][SIZE=3]i [/SIZE][URL="http://forums.qj.net/www.gamingwell.com"][SIZE=3]wonder what could be under this hyperlink..hmm[/SIZE][/URL][/CENTER] [CENTER][SIZE=3][COLOR=green][B][I]Maniakc is awsome!!![/I][/B][/COLOR][/SIZE][/CENTER] [CENTER][FONT=Arial Black][SIZE=3][COLOR=#660099][I][U][URL="http://forums.qj.net/member.php?u=58299"]The Brain Pwns!!![/URL][/U][/I][/COLOR][/SIZE][/FONT][/CENTER] [COLOR=sienna]Creator of:[/COLOR][URL="http://forums.qj.net/f-psp-development-forum-11/t-release-go-go-go-beta-66652.html"][COLOR=sienna]GO GO GO![/COLOR][/URL] |
|
|
|
|
|
#20 |
![]() Join Date: Feb 2006
Location: www.ultimatetalkforums.com Games, RPG, quickchat and more!
Posts: 531
Trader Feedback: 0
|
how can i fix it...
__________________
[CENTER][COLOR=black][COLOR=black][URL="http://forums.qj.net/f-psp-firmware-discussion-253/t-psp-firmware-30-get-it-58053.html"][COLOR=cyan]would you upgrade?[/COLOR][/URL] [/COLOR][FONT=Times New Roman][COLOR=navy][URL="http://www.mindistortion.net/iwantyoursoul/?i_am=altunozara"]OMG ITS REAL![/URL][/COLOR][/FONT][COLOR=black] [URL="http://forums.qj.net/showthread.php?t=61756&page=1&pp=10"][COLOR=lime]Sony vs Nintendo[/COLOR][/URL][/COLOR][/COLOR][/CENTER] [CENTER] [/CENTER] [CENTER][URL="http://www.ultimatetalkforums.com"][IMG]http://i94.photobucket.com/albums/l82/Altunozara/userbar2.jpg[/IMG][/URL][/CENTER] [CENTER][SIZE=3]i [/SIZE][URL="http://forums.qj.net/www.gamingwell.com"][SIZE=3]wonder what could be under this hyperlink..hmm[/SIZE][/URL][/CENTER] [CENTER][SIZE=3][COLOR=green][B][I]Maniakc is awsome!!![/I][/B][/COLOR][/SIZE][/CENTER] [CENTER][FONT=Arial Black][SIZE=3][COLOR=#660099][I][U][URL="http://forums.qj.net/member.php?u=58299"]The Brain Pwns!!![/URL][/U][/I][/COLOR][/SIZE][/FONT][/CENTER] [COLOR=sienna]Creator of:[/COLOR][URL="http://forums.qj.net/f-psp-development-forum-11/t-release-go-go-go-beta-66652.html"][COLOR=sienna]GO GO GO![/COLOR][/URL] |
|
|
|
|
|
#21 | |
![]() |
Quote:
__________________
[U][URL="http://www.speedtest.net"][/URL][URL="http://www.speedtest.net/"][IMG]http://img459.imageshack.us/img459/5021/darkhuntercopyrz9jx4.png[/IMG][/URL][/U] |
|
|
|
|
|
|
#22 |
![]() Join Date: Feb 2006
Location: www.ultimatetalkforums.com Games, RPG, quickchat and more!
Posts: 531
Trader Feedback: 0
|
...i just need to know how to loop something ive learned sooo much and i probebly am gonna buy a book :-D but what i wna do is learn how to loop then once ive just elarned that i can do simple text based c++ programs. Im going to improve my calculator and port it to the psp if i can.
-= Double Post =- t cant i just make a thing that sais something like if ( x == 1 ) restart; or something? then i can make it say please enter 1 to restart but i dont know the function to restart the program...
__________________
[CENTER][COLOR=black][COLOR=black][URL="http://forums.qj.net/f-psp-firmware-discussion-253/t-psp-firmware-30-get-it-58053.html"][COLOR=cyan]would you upgrade?[/COLOR][/URL] [/COLOR][FONT=Times New Roman][COLOR=navy][URL="http://www.mindistortion.net/iwantyoursoul/?i_am=altunozara"]OMG ITS REAL![/URL][/COLOR][/FONT][COLOR=black] [URL="http://forums.qj.net/showthread.php?t=61756&page=1&pp=10"][COLOR=lime]Sony vs Nintendo[/COLOR][/URL][/COLOR][/COLOR][/CENTER] [CENTER] [/CENTER] [CENTER][URL="http://www.ultimatetalkforums.com"][IMG]http://i94.photobucket.com/albums/l82/Altunozara/userbar2.jpg[/IMG][/URL][/CENTER] [CENTER][SIZE=3]i [/SIZE][URL="http://forums.qj.net/www.gamingwell.com"][SIZE=3]wonder what could be under this hyperlink..hmm[/SIZE][/URL][/CENTER] [CENTER][SIZE=3][COLOR=green][B][I]Maniakc is awsome!!![/I][/B][/COLOR][/SIZE][/CENTER] [CENTER][FONT=Arial Black][SIZE=3][COLOR=#660099][I][U][URL="http://forums.qj.net/member.php?u=58299"]The Brain Pwns!!![/URL][/U][/I][/COLOR][/SIZE][/FONT][/CENTER] [COLOR=sienna]Creator of:[/COLOR][URL="http://forums.qj.net/f-psp-development-forum-11/t-release-go-go-go-beta-66652.html"][COLOR=sienna]GO GO GO![/COLOR][/URL] Last edited by altunozara; 07-11-2007 at 08:32 PM.. Reason: Automerged Doublepost |
|
|
|
|
|
#24 |
![]() ![]() ![]() Developer
|
Just while (1) would do, because 1 would always be 1.
Also, regarding Code:
int mult ( int x, int y ); int addi ( int x, int y ); int subt ( int x, int y ); int divi ( int x, int y ); Maybe this subject is a little too advanced for you now, but it can cut down on redundant code with similar function structures. Try looking into it at some point.
__________________
GameSnooper - Random drawing of gaming news The 32 Bit Shell - My development blog (also includes gaming oddities) |
|
|
|
|
|
#25 |
![]() ![]() Developer
|
It was already mentioned that he doesn't need the functions altogether, since it can be done by straight use of the operators.
__________________
Raphs board rules #31: Excessive use of punctuation is either a sign of a lesser ego or a small mind. Avoid it if you don't want to look like a total moron. Raphs board rules #17: When you need to ask whether you are capable of doing something, you are not. Raphs board rules #2: Exploits aren't found by changing version numbers, blindly merging data into a file or turning your PSP upside down. Raphs board rules #1: If you have no clue how exploits work, don't come up with ideas about them. |
|
|
|
|
|
#26 |
![]() Join Date: Feb 2006
Location: www.ultimatetalkforums.com Games, RPG, quickchat and more!
Posts: 531
Trader Feedback: 0
|
so i just use this
while(x == 1) { //insert code here } and somehow once ive done a code and press enter when it would usually exit it does this while(x == 1) { //insert code here } ?
__________________
[CENTER][COLOR=black][COLOR=black][URL="http://forums.qj.net/f-psp-firmware-discussion-253/t-psp-firmware-30-get-it-58053.html"][COLOR=cyan]would you upgrade?[/COLOR][/URL] [/COLOR][FONT=Times New Roman][COLOR=navy][URL="http://www.mindistortion.net/iwantyoursoul/?i_am=altunozara"]OMG ITS REAL![/URL][/COLOR][/FONT][COLOR=black] [URL="http://forums.qj.net/showthread.php?t=61756&page=1&pp=10"][COLOR=lime]Sony vs Nintendo[/COLOR][/URL][/COLOR][/COLOR][/CENTER] [CENTER] [/CENTER] [CENTER][URL="http://www.ultimatetalkforums.com"][IMG]http://i94.photobucket.com/albums/l82/Altunozara/userbar2.jpg[/IMG][/URL][/CENTER] [CENTER][SIZE=3]i [/SIZE][URL="http://forums.qj.net/www.gamingwell.com"][SIZE=3]wonder what could be under this hyperlink..hmm[/SIZE][/URL][/CENTER] [CENTER][SIZE=3][COLOR=green][B][I]Maniakc is awsome!!![/I][/B][/COLOR][/SIZE][/CENTER] [CENTER][FONT=Arial Black][SIZE=3][COLOR=#660099][I][U][URL="http://forums.qj.net/member.php?u=58299"]The Brain Pwns!!![/URL][/U][/I][/COLOR][/SIZE][/FONT][/CENTER] [COLOR=sienna]Creator of:[/COLOR][URL="http://forums.qj.net/f-psp-development-forum-11/t-release-go-go-go-beta-66652.html"][COLOR=sienna]GO GO GO![/COLOR][/URL] |
|
|
|
|
|
#27 |
![]() ![]() It's good to be free...
|
The //insert code here is the code that you want to be looped. When you want to exit out of the loop, set x to any value other than 1, and at the end of that instance of the loop, it will cease to loop.
__________________
pəʇuɒɹɓ ɹoɟ ɓuɪɥʇou əʞɒʇ
|
|
|
|
|
|
#28 | |
![]() Join Date: Feb 2006
Location: www.ultimatetalkforums.com Games, RPG, quickchat and more!
Posts: 531
Trader Feedback: 0
|
ok so thats my code.... how would i make it go back to the start where you choose the options and you restart the whole thing when you come to a dead end?
__________________
[CENTER][COLOR=black][COLOR=black][URL="http://forums.qj.net/f-psp-firmware-discussion-253/t-psp-firmware-30-get-it-58053.html"][COLOR=cyan]would you upgrade?[/COLOR][/URL] [/COLOR][FONT=Times New Roman][COLOR=navy][URL="http://www.mindistortion.net/iwantyoursoul/?i_am=altunozara"]OMG ITS REAL![/URL][/COLOR][/FONT][COLOR=black] [URL="http://forums.qj.net/showthread.php?t=61756&page=1&pp=10"][COLOR=lime]Sony vs Nintendo[/COLOR][/URL][/COLOR][/COLOR][/CENTER] [CENTER] [/CENTER] [CENTER][URL="http://www.ultimatetalkforums.com"][IMG]http://i94.photobucket.com/albums/l82/Altunozara/userbar2.jpg[/IMG][/URL][/CENTER] [CENTER][SIZE=3]i [/SIZE][URL="http://forums.qj.net/www.gamingwell.com"][SIZE=3]wonder what could be under this hyperlink..hmm[/SIZE][/URL][/CENTER] [CENTER][SIZE=3][COLOR=green][B][I]Maniakc is awsome!!![/I][/B][/COLOR][/SIZE][/CENTER] [CENTER][FONT=Arial Black][SIZE=3][COLOR=#660099][I][U][URL="http://forums.qj.net/member.php?u=58299"]The Brain Pwns!!![/URL][/U][/I][/COLOR][/SIZE][/FONT][/CENTER] [COLOR=sienna]Creator of:[/COLOR][URL="http://forums.qj.net/f-psp-development-forum-11/t-release-go-go-go-beta-66652.html"][COLOR=sienna]GO GO GO![/COLOR][/URL] |
|
|
|
|
|
|
#30 |
![]() Join Date: Feb 2006
Location: www.ultimatetalkforums.com Games, RPG, quickchat and more!
Posts: 531
Trader Feedback: 0
|
i just started learning c++ like 3 days ago dont kill me cause i used c with c++....please answer my question
__________________
[CENTER][COLOR=black][COLOR=black][URL="http://forums.qj.net/f-psp-firmware-discussion-253/t-psp-firmware-30-get-it-58053.html"][COLOR=cyan]would you upgrade?[/COLOR][/URL] [/COLOR][FONT=Times New Roman][COLOR=navy][URL="http://www.mindistortion.net/iwantyoursoul/?i_am=altunozara"]OMG ITS REAL![/URL][/COLOR][/FONT][COLOR=black] [URL="http://forums.qj.net/showthread.php?t=61756&page=1&pp=10"][COLOR=lime]Sony vs Nintendo[/COLOR][/URL][/COLOR][/COLOR][/CENTER] [CENTER] [/CENTER] [CENTER][URL="http://www.ultimatetalkforums.com"][IMG]http://i94.photobucket.com/albums/l82/Altunozara/userbar2.jpg[/IMG][/URL][/CENTER] [CENTER][SIZE=3]i [/SIZE][URL="http://forums.qj.net/www.gamingwell.com"][SIZE=3]wonder what could be under this hyperlink..hmm[/SIZE][/URL][/CENTER] [CENTER][SIZE=3][COLOR=green][B][I]Maniakc is awsome!!![/I][/B][/COLOR][/SIZE][/CENTER] [CENTER][FONT=Arial Black][SIZE=3][COLOR=#660099][I][U][URL="http://forums.qj.net/member.php?u=58299"]The Brain Pwns!!![/URL][/U][/I][/COLOR][/SIZE][/FONT][/CENTER] [COLOR=sienna]Creator of:[/COLOR][URL="http://forums.qj.net/f-psp-development-forum-11/t-release-go-go-go-beta-66652.html"][COLOR=sienna]GO GO GO![/COLOR][/URL] |
|
|
|
![]() |
| Tags |
| code |
| Thread Tools | |
|
|