- Strength to Increase Rep
- +0
- Strength to Decrease Rep
- -0
- Upvotes Received
- 0
- Posts with Upvotes
- 0
- Upvoting Members
- 0
- Downvotes Received
- 6
- Posts with Downvotes
- 3
- Downvoting Members
- 5
6 Posted Topics
Re: [QUOTE=WaltP;1191957]It looks OK to me. Have you tried the easiest debugging of all? Use [B]cout[/B] to tell you what's happening as you progress through the program. After the switch output a message. After a read, output the data. Stuff like that. Put them where you think the trouble spots are.[/QUOTE] … | |
Re: Hi, C++ Maps are sorted associative containers that contain unique key/value pairs. Maps are sorted by their keys.When you insert new data into the map,Map will sort automatically.So you no need separate function to sort the data in Map. Forgive me if you are searching any other kind of sort. | |
Re: if(answer_3=='paris') is not a correct statement. bkz answer_3 is char and 'paris' is not a char.so u can't get the answer as u expected. change the answer_3's type as char array instead of char. use strcmp() function to compare the answer_3 and "paris". NB: string literals should be within the … | |
I hope, this is not a compiler issue. See the below code [CODE]#include <iostream> #include <string> using namespace std; string data,name; void getTst() { cout<<"Enter Name :"; getline(cin,name); cout<<"\nENter data :"; getline(cin,data); } void dispTst() { cout<<"\nName :"<<name; cout<<"\n Data :"<<data; } int main() { int tmp; cin>>tmp; getTst(); dispTst(); … | |
Hi, plz find my small solution. [CODE][COLOR="Green"] #include <iostream> #include <ctime> #include <string> using namespace std; class cPlayer { public: [COLOR="red"] string Pl_name;[/COLOR] int pos; int pts; }; cPlayer p1, p2; int random(int nMin, int nMax) { return rand() % (nMax - nMin + 1) + nMin; } int main() … |
The End.