481 Posted Topics
Re: use a switch statement, then call the function you are after. [CODE=C++]switch(b){ case 1: menu1(); break; case 2: menu2(); break; case 3: menu3(); break; default: std::cout << "Invalid Choice!"; break; }[/CODE] I think that is what you are after, Chris | |
Re: The file will be read line by line. So the first line would be stored in the first variable. Ofcourse, if you want to make it possible to loop throught the file until all the variables are read in then your best bet would be to use and array (not … | |
Re: How well do you know the language, i'm guessing not too well. What kind of game do you want to make. A full blown first person shooter? or a guess the number game? Either way more input would be helpful aslong as sample code. Chris | |
Re: No, there is not standard C++ method of doing this, or at least not that im aware of. If your using linux i believe the ncurses or pdcurses headers may have something to heklp you out. If your on windows then you can use windows.h [CODE]ReadConsoleOutputCharacter( __in HANDLE hConsoleOutput, __out … | |
Re: You should have a read about functions and parameters. [CODE=C++]#include <iostream> int Plus(int x, int y){ return x + y; } int main(){ int number; int number2; char op; std::cout << "type in a number" << std::endl; std::cin >> number; std::cout << "another number" << std::endl; std::cin >> number2; std::cout … | |
Re: indeed, you must use the cmath header... pow() and also sqrt() will find the square root of a number xD pow takes to aruments first is the number to be raised to the powerof the second number if that makes sense. Also i should talk about the chain rule. the … | |
Re: Hey, enjoy your stay. This may help clear anything up that your unsure about if you wan't already use it, you should! [url]http://java.sun.com/docs/books/tutorial/[/url] Chris | |
Re: strtok() would help. read some online documentation on it. It splits a string based on a delimiantor such as a pipe, this would allow you to retrieve all the different ssctions between the pipes. Then you could further process the {} out of the data. Chris | |
Re: Wrong it does, pick a number >= 60 it will work fine. mpm is an integer, integer's ignore and decimal places, so and number small that 60 when divided by 60 would make mpm equal to 0, thus 0*2 = 0, so the program continues to loop multiplying 0 by … | |
Re: If you are looking to convert strings and into integers, you may want to check out the atoi() function. Chris | |
Re: Just had a quick look but something im gonna point out. [CODE=C++]else if ((a >= 4) && (a < 5)) { romanF[i] = 'I'; romanF[i+1] = 'V'; a = a-4; i += 2; }[/CODE]could become [CODE=C++]else if (a==4) { romanF[i++] = 'I'; romanF[i++] = 'V'; a -= 4; }[/CODE] This … | |
Re: Ye this is true no respectable forums will do your assignment for you. So you have 2 choice's pay someone...again good luck cause most ppl still won't do this OR DO IT YOURSELF(at least have a good go) YAY im joining in with the free posts, i love it! | |
Re: Btw, atoi() will convert it to a number, this may prove helpful for you to multiply your numbers. It will also convert it back to a char from a number. Chris | |
Re: Try using this [CODE=Python]if __name__ == '__main__': main()[/CODE] That may help. I'm guessing you are familiar with it, and therefor i don't need to explain Chris | |
Re: So you change the default program from notepad or whatever to your program, ofcourse this is all done in the registry. Which if you have a look through you will find that the extention .txt will trigger myapp.exe you can append a paramater on the end of that which represents … | |
Re: [QUOTE=Denniz;705288]Is it part of the requirements to use recursive function? This program can be done easily without recursive function. Just use a loop is enough. Also, check out rand() function to generate random number, and srand() for seeding the random generator.[/QUOTE] Why would one need to generate a random number … | |
Re: you need to use getline() in that case to allows you to read more than just 1 character in at a time Chris | |
Re: More information would be nice but im kinda guessing it a mere spelling error should it be double a=(h[0]*h[1])+...... Thats all i can guess from what you provided Chris | |
Re: As in the favorites tab? Start-->Settings-->Taskbar & Settings. It's then the second tab along i believe that should allow you to restore your favorites Tab. Chris | |
Re: Have a look at partioning software such as partition magic. This should run fine from boot of a floppy disk and allow you to delete all partition on the computer leaving it blank ready for OS installation. Providing the bios isn't screwed and will allow for boot from cd Chris | |
Re: The simple solution may just be re-install IE im guessing its IE7, should fix it Chris | |
Re: Hmm...show us some work? Lets see how far you get. Let us know where you get stuck. Read up on Lexical Analyzers...[url]http://en.wikipedia.org/wiki/Lexical_analysis[/url] | |
Re: I'm not sure if i understood you but i think you are after something like this, windows only all i could find [url]http://www.rutherfurd.net/python/sendkeys/[/url] | |
Re: Indeed, however i have a feeling it may be a similar problem to this.... [CODE=C++]if (v1[j]==v1[i]) { v1[j]==""; }[/CODE] What exactly does this do? | |
Re: I trust you have installed all of the required libraries etc And set up all global varialbles. once all is set up i believe this should work [CODE]g++.exe "C:\file.cpp" -o "C:\File.cpp" -I"Include directory" -I"another include directory and so on" -L"libraries" [/CODE] and to run it [CODE]start C:\file.exe[/CODE] | |
Re: @plum Aslong as he doesn't mind his program being 100% accurate the latter is good idea. A bit more information about the latter for you, time() comes with the including ctime, i'd suggest having a read about the ctime header and all of its functions [url]http://www.cplusplus.com/reference/clibrary/ctime/[/url] Chris | |
Re: My clue for you > Our Software Development forum category encompasses topics related to application programming and software design. When posting programming code, encase it in [code], [code=syntax], where 'syntax' is any language found within our Code Snippets section, or [icode], for inline code, bbcode tags. Also, to keep DaniWeb … | |
Re: To run your program for a specific amout of time, you are correct you will need threading. Once you understand threading, you may want to have a look at the ctime header [url]http://www.cplusplus.com/reference/clibrary/ctime/[/url] This will provide a method of checking how long the program has been running, you would set … | |
Re: If you want to use getline() then strtok() would work perfectly for you. To split the line of text into indervidual words Chris | |
Re: As in 2 .cpp files and a .h, If so then perhaps you could show the error log. | |
Re: Actually it can turn into a game, there a ae many different arrangements of cells in the game of life, which have different names, sch as glider -- these will move in 1 direction continually untill another live cell interupts this. Many appterns can be created to do many differents … | |
Re: It has already been pointed out to you. [ICODE]if (genArray[i] == "ACG")[/ICODE] This will not work, your are comparing a char* with a string. As it has already been pointed out. I'll just restate the fact you need to check character by character [CODE=C++]if (genArray[i] == "A"){ if (genArray[i+1] == … | |
Re: Realtek may be able to help you out. They have drivers compatiable with ALOT of sound cards | |
Re: Check you don't have any extra programs trying to launch on boot that you do not want and may be causing this. Just check.. Start->Run->msconfig | |
Re: Scan your pc using any half decent spyware removal tool / ad-ware removal tool. If it cannot fix it, then it will more than likely tell you which file it is embedded in so just find it and delete it yourself. BTW post in the correct forum please. | |
Re: Doing it a long hard way here is a brief explanation. If you have a integer input then you first need to split it into indervidual numbers i.e 11010111 would become 1 1 0 1 0 1 1 1 (spaces show a split into an array or whatever) Then you … | |
Re: You have to create a date object from the text box text before you can compare it to another date object I believe not a VB.NET programmer :/ | |
Re: [CODE=Python]# adding to christ o'leary's fight function # to have integer returned use # x = random.choice([0, 1]) # print x, type(x) # testing # or x = random.randrange(0, 2) # print x, type(x) import random def main(): global monster_HP1 monster_HP1 = 5 global hp hp = 10 print """you … | |
Re: This sound to me like it is your Anti Virus, anti virsus software has been known to corrupt and drop alot of incoming packets. After disabling / uninstalling your anti virus, you may need to restore one specific file on your PC this can be done but i cannot remember … | |
Re: You are still trying to print out the value of a before you have retrieved its value from the user via scanf() | |
Re: You will need to install all the drivers listed on the [URL=http://h10025.www1.hp.com/ewfrf/wc/softwareList?os=228&lc=en&cc=us&dlc=en&product=1842155]manufacturers site[/URL] | |
Re: Get us started with some code and we will love to help you, | |
Re: A quick google turn up what look to be a nice [URL=http://www.javaworld.com/javaworld/jw-03-1999/jw-03-dragndrop.html]page[/URL] Google is your friend, also if you don't know java to well i would recommend getting to know it a bit better first Chris | |
Re: [CODE=C++]#include <iostream> using namespace std; const int Months = 12; const int Years = 3; int main(){ const char * months[Months]={"Jan", "Feb", "Mar", "Apr", "May", "June", "July", "Aug", "Sept", "Oct", "Nov", "Dec"}; int temp = 0; int sales[Years][Months]; cout << "Enter the sales data for each month during 2005-2007.\n"; for … | |
Re: Have you tried booting in safe mode, that might allow yuo to login in correctly then delete any files that may be cause the problem | |
Re: [QUOTE=carlcarman;701690]Make sure you have at least 2GB of ram.3 GB or more makes it run smooth[/QUOTE] this is True, i am running a 3gb RAM vista box, bost of the time at least 40-50% of my RAM is in use just to allow vista to run. So anything less than … | |
Re: Do you have this problem whilst your are completely disconected from the internet? Sometimes download trojans and things can cause this, if you find that being disconnected from your internet solves this then you may be ok. The other problem may be your graphics card, if you have a faulty … | |
Re: [QUOTE=jlm699]This depends on the type of system you're on. \r\n is Windows, \n is Linux, and I believe that \r is Mac (although I've never used one so I don't really know). [/QUOTE] Yer thats the correct line endings for each different OS, and if you intend to have it … | |
Re: The reason your code got shifted to the left was because you didn't use code tags, another thing pointed out in posting guide lines |
The End.