- Strength to Increase Rep
- +7
- Strength to Decrease Rep
- -1
- Upvotes Received
- 28
- Posts with Upvotes
- 21
- Upvoting Members
- 19
- Downvotes Received
- 3
- Posts with Downvotes
- 3
- Downvoting Members
- 3
Re: [code] int main () { //Declare variables int choice; //Set the numeric output formatting //cout << fixed << showpoint << setprecision(2); do { //Display the menu and get the user's choice. showMenu(); cin >> choice; //Validate the menu selection. while (choice < 1 || choice > 5) { cout << … | |
Pretty neat text-based RPG that I made. Currently my first game. | |
Well we all have seen the common questions on creating squares and hollow squares out of asterisks in C++, but how about creating a program that prints out a circle in asterisks? Obviously this would look like an oval due to line adjustment, but it would be quite interesting to … | |
I accidentally posted a lower version of the game that had more flaws, and a few less features. This one has a few more minor bugs fixed, and a power attack instead of a normal attack. | |
Re: Pretty long, ALMOST twice as long as the rpg I made a little while back. Sadly it does not work in VC++, did you use Dev? (102 errors) | |
I keep getting errors and I don't know why.. #include <iostream> using namespace std; class IceCream{ private: int flavor[3]={0,0,0}, topping[3]={1,2,3}, scoops[3]={4,5,6}; public: int getFlavor(int); int getTopping(int); int getScoops(int); void setFlavor(int); void setTopping(int); void setScoops(int); }flavorX, toppingX, scoopsX; int IceCream::getFlavor(int choice){return flavor[choice];}; int main() { cout << flavorX.getFlavor(1); system("PAUSE"); } | |
Hey everyone, I am taking an online C++ class and part of our assignment is to complete a whole bunch of small program snipits on a site called myprogramminglab.com. This one program seems to have me stumped as I am not very familiar with Data structures. Could someone help me … | |
| |
Hey guys, I need a really simple code for chatting across consoles. I have looked up many tutorials on how to do this, yet they all seem to fail. All I want is a VERY simple chat that sends data from the client to a file, and then receives the … | |
Hey Everyone. I recently created a game in abode director, and lost the .dir file. I currently ONLY have the .dcr, and back when I created the game, I added an obnoxious 'permanent' banner to an old affiliate who did not support me back. (So I would prefer to no … | |
Re: Well, you can "Jump" To different sections using a simple goto statement. However, goto's mess up the format of your code, and therefore is bad practice. So I would recommend using while/do-while/for loops to go to different parts of your code. If you don't care about your format, then here … | |
Re: [QUOTE=Suzie999;1344486]I've noticed a lot of posts here with kids wanting their homework done. Is this a new thing or has it always gone on? and does anyone ever fall for it?[/QUOTE] Yes and Yes. Although people who give the codes away without any effort from the receiving end and those … | |
Re: When you run the program select, Debug > Run without debugging. This makes it so the screen will stay open. Or you could use System("Pause"); but that makes your code un-portable. Or you could use cin.getch or something like that. | |
Hello all, I need help with a scientific notation problem. I am to create a program where the user enters a 5 digit number, and it is displayed in scientific notation. This part is easy, however I am trying to take it to the next step and make it so … | |
Re: Looks fine to me. [code] #include<iostream> #include<String> using namespace std; string __stdcall myFunc(string s) { if (s == "banana") { return "Good String"; } return "Bad String"; } int main(){ string s = "banana"; cout << myFunc(s) << endl; } [/code] ***Maybe you forgot the "#include<String>" header? | |
Re: Please use code tags, and all of the "text" in the switch statement is not needed. You just need to change the amount within the switch. you also have a few unneeded headers. Also, your decimal allocation code is a bit long, and you can shorten that up to one … | |
Re: My first game I wrote was an rpg(made it yesterday), so yes..I am new as well. As a matter of fact, I've only been learning c++ this month. Anyhow, make an RPG where you choose your character and battle enemies...it isn't as complicated as you would think. | |
Have any of you just felt like expressing your feelings through text in the most efficient way possible? Well Poetry can usually satisfy that urge. So post them here, and comment on the ones you would like. I myself am not a writer or anything close to that, but I … | |
Re: ACII characters are just a bunch of random characters assembled to create one grand character. Here is an example of a 'T' in ASCII: [code] ************* ************* *** *** *** *** [/code] | |
Re: why is 'Rob' capitalized in robot? Is this in dedication to Robert Martinelli? But yeah, you need to start off with the basics first. ;D | |
Re: I looked at it, and I would suggest adding a random number between 1-4, and then adding a simple 'switch' statement to change the comment based on the random number. And as hnizamoglu said, it would be more convenient for us if you posted the code embedded into the site … | |
Re: Yes it is possible. You can use any of the following functions to do so as well: The standard, unportable [URL="http://linux.die.net/man/3/system"]system()[/URL] process, or these ones which give you a bit more control: [URL="http://www.manpagez.com/man/2/fork/"]fork()[/URL], [URL="http://linux.die.net/man/3/exec"]exec()[/URL], [URL="http://msdn.microsoft.com/en-us/library/ms682425(VS.85).aspx"]CreateProcess()[/URL] | |
Hey everyone, I got bored and decided I wanted to make a 'pitch' cards game in c++, however I came across the problem of generating all 52 cards in a deck without duplicating the same card. So basically, I just want to print out every single card in the deck … | |
Re: So many errors. Your semicolons were in the wrong place, you have the incorrect definition of using greater-than/less-than symbols, you should switch to the header, <iostream> without the ".h". You also need to make the main function, "int main()", not just main. Well, there may be errors, but I got … | |
Hello everyone, I am trying to make a simple web browser for my own benefit (not a school project). I have been looking through multiple videos on how to do so, and could only find 'simple' web browsers on almost every video for visual c++. Anyway, the videos work, but … | |
Hello, I have been having a problem with the following code: [code] #include<iostream> #include<time.h> #include<iomanip> using namespace std; int main() { float average; setprecision(5); fixed; average = 100-((25/(130-(50-(130/3))))*100); cout << average << "\n\n"; } [/code] I cannot seem to get the 'average' variable to come out to exactly 79.73 like … | |
Well, I had my program running perfectly, and I was quite pleased with the results. However, after I made the text file a bit big, the program just stopped working all together. (255 lines of text) so I 'suppose' it is a bandwidth problem..however 255 lines of text is like … | |
Heh, well my daily project is near finished, and I was looking around for a way to get rid of punctuation from a character array. I looked through the web a bit, and only found immensely complicated formulas which I did not feel like dealing with. So my question is: … | |
Please tell me why this doesn't work: [code] #include<iostream> using namespace std; int main() { char felix[3] = "ho"; if(felix == "ho") cout << felix; } [/code] | |
Hey guys, sorry I am asking so many questions lately, but I am learning this stuff by myself, and find it easier to ask questions here than look online. Plus when I try using the search engine on this site, it takes me to some quite random threads. Anyhow, onto … |