1,362 Posted Topics
Re: At least [URL="http://www.thescripts.com/forum/thread745758.html"]one[/URL] | |
Re: But with Windows(r), you can do the same thing over and over again, and get different results. That's insane, as well. Val | |
Re: It would help if you post the code you have, then those who help will have an idea of where to start. To begin with, have you constructed a loop that ends either when the user has a correct guess or has used up the eight attempts? How did you … | |
| |
Re: A. Indent B. Are you up to 2D arrays yet? C. Use of global variables is generally frowned upon - that's where a 2D array would help in being a single item to pass as parameter to functions. D. If it doesn't compile, what error message do you get? Where … | |
Re: I NEED HELP PLEASE!!! WHAT AM I DOING WRONG!!! Not reading the compiler's error messages is the first thing. When dealing with arrays as arguments to function, you do not use the &. [code] void search( ArtWork [] ); // not ( ArtWork & ), thats for passing a single … | |
Re: Anyone remember Thunderbirds and Fireball XL5 - the shows done with puppets/marionettes? Val | |
Re: The problem is given in terms of rows of data, you show it in rows and columns. Why aren't you using a 2D array to store the data? That makes it much easier to keep track of where you are. The code you provided does not compile. It would be … | |
Re: int main( ) { int matrix[10][10]; return 0; } Now, what do you need to do with it? What's the problem, show the work you've done, explain where you feel you are having difficulty. Val | |
Re: [QUOTE=Ancient Dragon;481831]doesn't work on MS-Windows os.[/QUOTE] Worked for me on XP, with VC++ 2005 express. After dropping the ".h" from iostream header. Well, I can't say the system(pause) worked, I killed it long before the movie finished. Val | |
Re: [QUOTE=platotld;480206]It was a port issue. The firewall port was wrong, it was somehow altered. Using KB306759 I went into the registry and seen that the port # had been changed and I just went into the firewall and set it to the number in the registry and away she went. … | |
Re: You might get more help if you'd posted this to the C++ forum. As to storing face values based on your loop index, your if...else branching seems adequate. As you proceed, the Ace will be a problem in scoring - you will have to consider it as either a 1 … | |
Re: That is a O(n) - it runs in linear time. We don't consider how many lines in the file - the idea of O() notation is to generalize how the work grows in relation to the problem size. Whether on particular algorithm does something in three operations per step and … | |
Re: Something that will cut the tedium of switches based on letter input: [code] #include <cctype> //other header stuff char input; cin >> input; input = toupper( input ); //force value to upper case switch( input ) { case 'A': //stuff break; case 'B': //stuff /break //etc } [/code] | |
Re: What is the data type of 'repeat'? It should be a char for your while condition to work. Val | |
Re: There are several. Do a search on this site and you'll find this question has been asked and answered numerous times. See the last response in this thread: [url]http://www.daniweb.com/forums/thread82344.html[/url] Val | |
Re: Please read the announcements at the top of this forum. You will most likely get help when you show you've tried to solve your assignment, then ask questions about specific problems you're having. Here's starting tip for you - use getline( ) specifying '#' as the delimiter, except when reading … | |
Re: It's hard to know what help to give, where to point you, without knowing how much you can accomplish on your own. Please make a start on the assignment and post it here, then we can figure out what aid you need. Val | |
Re: No, you're not calling the sort function according to its parameters. [code] void selectionSort(int *array[], int size) [/code] However, it's the parameter that is wrong. Why do you have an asterisk in the array parameter? And why is minElem in the sort function a pointer? Val | |
Re: [QUOTE=zandiago;471692]lol...keep em coming....for me...don't diss my F-18...you'll be in big trouble.(look inder the wings)[/QUOTE] Umm, your F-18 is really an F-16. Count the vertical stabilizers. Val (retired USAF) | |
Re: To do the average grade calculation for each of the students, your AvgGrade2 function should call AvgGrade1 for each element of the array. So, you need to pass to AvgGrad2 the array, the number of students, and the number of tests. Use a loop in the function, sending each student … | |
Re: [QUOTE=bumsfeld;476072]Is this very important?[/QUOTE] It is if you plan on getting a cat. Girl cats generally won't soil your furniture as much, and won't embarrass you when they lay on their backs and get aroused. On the other hand, you'll want to buy good earplugs if you have a girl … | |
Re: Just what is this section supposed to be doing? Walk through it by hand and analyze what it is REALLy doing. [code] while ( !input.eof( ) ) { input >> value; count++; for ( int i = 0; i < count; i++ ) { input >> med_val[i]; } } [/code] … | |
Re: Many here will help, but no one will write it for you. Please post a copy of what you've done to solve the problem, and tell us where you feel you're having difficulty. Start with pencil and paper - outline the steps the program must take, then refine those to … | |
Re: When you do the [inlinecode]fin3 >> a >> b;[/inlinecode] after having read all the data in that file, the inputs fail, but the values in the a and b variables remain unchanged. The eof( ) does not halt the reading until you've actually tried to read past the end. Given … | |
Re: You're off to a right start on the reading,but you need to use a different method of stopping the loop, and getting next data. Your code: [code] indata>>StoreID; indata>>ProductsSold; for(int size=0; size<40; size++) { StoreID=Sales[size]; index = LinearSearch(StoreID, arraysize, ID); if (index<0) { ID[size]=StoreID; Sales[size]=ProductsSold; size++; } else Sales[size] += … | |
Re: Take a look at code snippet: [url]http://www.daniweb.com/code/snippet97.html[/url] which can play frequencies directly as MIDI output. Val | |
Re: [code] int i = 0; inFile.read((char *)&personInfo[i], sizeof(Employee)); while (inFile) { inFile.read((char *)&personInfo[i], sizeof(Employee)); i++; } [/code] note that you read into position 0 of your array, then read into it again, overwriting the first record. Put the i++ as the first action in the loop body. Val | |
Re: [code] while (!cin.eof() || a != prod) [/code] will continue as long as the user has not hit ctrl-z OR has a wrong answer. try using AND remember that the modulus operator (%) will give results in the range 0-(divisor -1) - check your switches, and the values you are … | |
Re: I prefer #3. Are we grading a contest or homework? Val | |
Re: Look at how you're doing the comparisons in binary search function. What's really being compared? | |
Re: Since you don't have any information beforehand telling you how many iterations the loop will go, a for loop is not a good choice here. As it's some condition that arises during the run, a while loop is the better choice, or even better, a do...while. [code] do { //read … | |
| |
Re: Follow the link: [url]http://www.childfriendly.org.au[/url] to find resources to help. Maybe if the link was interleaved with the scenes it would be more effective. And this is just one of several ads put out by that agency. | |
Re: I quit at 186K, 5 levels. Closest I got to any single place was 43km Val:cool: | |
Re: If it's the use of command line arguments that's giving you pause, here's a couple links with helpful information: [url]http://malun1.mala.bc.ca:8080/~wesselsd/csci161/notes/args.html[/url] [url]http://www.cprogramming.com/tutorial/lesson14.html[/url] Textbooks seem to generally ignore this topic. Val (Sorry, AD, it's early and I didn't see that your comments included a similar link.) | |
Re: If your group is too Politically Correct, yes, it can vapor lock and get nothing done. Would you care to describe your problem more fully, so someone can give a serious answer? | |
Re: [QUOTE=np2100;475269]I know my code is bad however my problem is that after i average the grades i want to store that average as a variable. Ive tried doing (gradea + gradeb + gradec + graded + gradee + gradef)/6= average and cin>>average but i cant it doesnt work. Any alternatives??[/QUOTE] … | |
Re: If that's your shopping list on the worst BF, I'd hate to see what you spend in a good year?!?!?! Looks like quite a few good deals there - laptops with more horsepower than last year's deals, at similar prices. Val (planning on sleeping in that morning. really late!) | |
Re: [QUOTE=Salem;474857] If you live in the northern hemisphere, you need to get one which spins clockwise, whereas if you live in the southern hemisphere, you need one which spins anticlockwise ;)[/QUOTE] That's been proven incorrect time and again. You can make your drives spin either direction in either hemisphere. On … | |
Re: Why is the argument passed by reference? You are returning the result directly. Reference parameters in recursive functions are tricky things - every instance of the function may be modifying the same object in memory. And you cannot use the reference parameter in the expression [inlinecode] return F( n-1 )....[/inlinecode] … | |
Re: Yes, you want to do a loop. Assuming you've read in text to a string, and you have the character at which you want to stop, you can either loop through the string displaying a character at a time till you find the stopping char or you run out of … | |
Re: You're trying to swim against the (file)stream. [code] ifstream income; income.open ("Income.txt", ios::in); ifstream fixed_expenses; fixed_expenses.open ("Fixed Expenses.txt", ios::in); ifstream variable_expenses; variable_expenses.open ("Variable Expenses.txt", ios::in); [/code] You are opening file handles of type ifstream, which are by default input handles. So, you don't need the "ios::in" mode parameters. But, you … | |
Re: It's what I've used everywhere I've worked for 20 some years, going back to Win3.1. At home, I've got several major apps I use that are not available for other platforms. Then there's just plain inertia. Macs are looking more enticing. Wish there was a standalone box between the Mini … | |
Re: [QUOTE=vishesh;474162]Take number as string. Also long int, long long etc etc may take number till 10 digits.[/QUOTE] long int (on most 32 bit systems, anyway) will not take full range of 10 digit numbers, as it's allocated just 4 bytes. long long int will be sufficient, handling full range of … | |
Re: [QUOTE=bumsfeld;465728]Lardmeister, do you have an answer to everything? The Saudis and their royal family are our best friends![/QUOTE] They are not our best friends. They are not even friends. They are, at best, wary allies who really don't like us at all. Been there, seen that. Val | |
Re: You could read each input line with the getline( ) function. That throws away newlines when encountered. Assuming each input line ends with the newline immediately after the last nonwhitespace character, you will have to be sure to insert a space into your output before adding on the next input. … | |
Re: [QUOTE=ganbree;472817]But in case you don't have a book... [B]return[/B] can only be passed one value. However it could be an array if they are of the same type.[/QUOTE] That depends on what sort of "array". A locally declared array, such as [inlinecode] int ret_arr[10]; [/inlinecode] cannot be the return value, … | |
Re: "void main() -- main() has NEVER been a void, always an int, see this" But I beg to differ a bit - once upon a time main( ) was a void function. Read K&R recently? The earliest C++ book I have, circa 1993, uses the form [code] main ( ) … |
The End.