No one has voted on any posts yet. Votes from other community members are used to determine a member's reputation amongst their peers.
11 Posted Topics
I am getting this error and i don't know what it means. this is my code, i do have header files but i didn't include them. [code]int main() { [LIST=1] [*] cout<<"Welcome to guitar hero"<<endl; [*] cout<<"Try and press the correct letters on the line"<<endl; [*] cout<<"You will use the …
couldn't you just use string copy. [inlinecode]strcpy(orignal_variable,new_variable); [/inlinecode]
[code] char state_name[2]; // switch expression of type 'char [2]' is illegal, integral expression required state_name[0] = stCode1; state_name[1] = stCode2; [B]switch(state_name)[/B] { case 1: ("AB"); elect_votes = 20; // break; case 2: ("DO"); elect_votes = 15; // break; } [/code] you can't put a character string or array in …
[QUOTE=henpecked1;561336]I'm trying to write a while loop to terminate a program when asked if you want to enter another name and the answer is no (or a number since I'm using character strings) [/QUOTE] i think you should just make a condition in the while that if they answer no …
im making a battleship game and so far i have this but im getting an error and i don't know what it means, this is the error [inlinecode]error C2664: 'strcpy' : cannot convert parameter 1 from 'char' to 'char *'[/inlinecode] this is my code [code=cplusplus] #include <iostream.h> #include <stdlib.h> #include …
i want to return 2 values but i don't know how i can do that. this is part of what i have done, i want to have choice[0] and also choice[1] be returned. also how can i store them in 2 different variables in the main. [code] int pick() { …
hi, i need help with how to find the max number and min number from an array. there are 31 numbers, i know that i am suppose to use a for loop to do this and this is what i got so far array is inputed by user [code] #include …
i have a question, why can't i do this, there are three errors and i don't know what they mean [code] #include<iostream.h> float celsius_to_fahrenheit(float); int main() { float fahrenheit; float celsius=22.5; fahrenheit=celsius_to_fahrenheit(celsius); cout<<celsius<<"C="<<fahrenheit<<"F\n"; return 0; } celsius_to_fahrenheit(float celsius) { return(celsius*(9.0/5.0)+32.0); } [/code]
if you do use sytem("cls"); then you will have to put in time wasting loops or else you won't be able to see much because the system("cls") will clear it all before you get to see it. so in short use some time wasting loops in it if you do …
in my c++ class we have to make a game and i need some ideas on what to make. the only thing i have learned is: random numbers, ifs, switch case, while loop, for loop, some character string functions of cin.get and cin.ignore, also declaring a character string, data formatting …
hi, I'm in a high school c++ class and I love it, i love c++ and next year i will move onto java. i am here so i can learn more about c++ than the school teaches. i hope i learn many new things
The End.
mr.cool