1,358 Posted Topics
Re: Kudos for admitting it's homework. Look through your book better. If it's any good at all, the tutorials and examples you need are all right there in front of you. They may not be the answer to the problem, but you should be able to adapt them to it. | |
Re: 1.) Please use [b][noparse][code-syntax]...code tags...[/code][/noparse][/b]. They make your code easier to read. 2.) You are making a common rookie mistake. You're using assignment statements instead of equality statements. Take another look at the operators used in your comparisons. | |
Re: You'll have to study the ECMA-262 standard as well as several HTML specifications and a few other standards. Let us know how it goes. | |
Re: [QUOTE=nav33n;1113570]What are you testing btw ?[/QUOTE] And why is his name so creepily similar to yours? I might suggest watching this user, it's their first post. Another forum I'm a member of had a user do the same thing. It turned out to be a spambot. | |
Re: [QUOTE=faaz;1111194]well if it is in the loop like this: then if i input say 5 it would say the sum of the number is 5 and it would say enter a number, if i enter 5 it would give me 10. however that is not what the problem is asking … | |
Re: almostbob's idea is probably better. But, if you have to use JavaScript, you will have to close the PHP block before you include it then re-open it after the JS. Otherwise, your JS will get eaten by the PHP parser and cause issues. | |
Re: [code=c++]while ((repeat = y) || (repeat = Y));[/code] You are attempting to assign the variables 'y' and 'Y' to the variable 'repeat' rather than comparing to the characters. There are two issues: 1.) You need to use the equality operator not the assignment operator. 2.) To make the compiler consider … | |
Re: um...... Use the less-than relational operator '<'. It doesn't take a geek to figure that one out... :P | |
Re: I suspect this is beyond my abilities at the moment. But perhaps we can clarify for someone else... Your example looks like a series generator. Are you trying to accept seed values (I think d, T, k, and 'alpha') which are then used as the starting point for generation of … | |
Since [URL="http://www.daniweb.com/forums/thread251025.html"]this thread[/URL] was solved/closed about 2-weeks ago, I have not received any subscription messages at all. During that time, I should have received about 15. Did the mail server somehow swing from one extreme to the other? Did the server's IP or mail address change since then? Do I … | |
Re: Having trouble making sense of your code. Please re-post using code tags. /*this is what you'll get */ /* and you're more likely to get help... */ | |
Re: The errors don't appear to be related to your use of "setw()". The numbers in parentheses after the file path and name are line numbers. Double-click on one of them to go to the line where the error is indicated. Always fix the first error listed first, it may be … | |
Re: Your objects are set to [icode]const[/icode]. You can't hope to accomplish anything if they are constants. Start by making the objects themselves non-const then go from there. You can use [icode]const[/icode] for arguments/parameters/methods without having the original variables/objects set as [icode]const[/icode] themselves. | |
Re: A vector probably would not be the best choice unless you create 2 parallel vectors and manage them accordingly. A multi-dimensional array could work, but you would have to be careful about your capacity. You would have to use a high-precision dataType like a [icode]double[/icode]. I don't know the precision … | |
Re: [QUOTE=yUhki;1112373]In a gymnastics or diving competition each contestant`s scores is calculated by dropping the lowest scores received and then adding the remaining scores.Create a program that allows the user to enter 8 judge`s scores and outputs the points received by the contestant.Format the output with two decimal places. ( A … | |
Re: For a how-to, try this: [url]http://www.cplusplus.com/doc/tutorial/functions/[/url] For some reference material, try this:[url]http://www.daniweb.com/forums/thread235535.html[/url] (There are a few other links in some of the responses.) | |
Re: I can't help you with MFC, but this: [icode]if(s == correct)[/icode] is most likely not correct unless you have defined 'correct' as some sort of macro or a variable. If you are trying to compare to a string literal, you need double-quotes (" ") around the literal:[icode]if(s == [b]"[/b]correct[b]"[/b])[/icode]. Without … | |
Re: Almost all modern consumer-grade processors are x64 architecture with an x86 subset. Whether you are processing x64 or x86 instructions depends on if the operating system is written for 64 or 32 bits respectively. | |
Re: You should be able to open any standard *.cpp and *.h files without any special steps. What exactly is the issue you are having? Are you trying to open the sources in VC++ and can't? Or are you trying to compile them after writing them for a different compiler and … | |
Re: The compiler is probably complaining that you are either trying to resize an existing array or are going outside its boundaries. If you only need a single dimension, try using vectors instead they're a little more flexible. You can dynamically resize a vector using [icode]vectorName.resize(wordLength)[/icode]. You really can't do that … | |
I just started an advanced C++ course and my instructor sent around a file with this piece of code: [code]class smallobj // specify a class { public: smallobj() : iData(0){} // Constructor smallobj(int iInValue) : iData(iInValue) {} // Overloaded Constructor ~smallobj() {} // Destructor void setdata(int d) // member function … | |
Re: I think there is a way to do it by manipulating the output stream's formatting, but I'm not totally familiar with that yet. In the meantime, you could just multiply by 100 when you output it. [code=c++] float percent = 0.0f; float value1 = 12.0f; float value2 = 48.0f; percent … | |
Re: [QUOTE=niek_e;1101185]Never use goto. It's bad coding practice. Instead, you can put the entire switch in a while(something) loop. [B]When you want out, just make "something" true[/B]. For example: [code] bool looping = true; while (looping) { switch (foo) { case 1: std::cout << "1!, stop looping!"; looping = false; break; … | |
Re: There are a couple ways to do it. 1. AJAX 2. Self-validating page/form AJAX is a procedure (not a language) that uses JavaScript, XML, and PHP to dynamically change the contents of a web page without completely reloading it. You would use JavaScript to get information from your form and … | |
Re: [QUOTE=nats01282;1097035]Hello all. im new to mySQL database so dont know very much so sorry if its a daft question. I have a mySQL database with a company called 5quidhosting but my hosting is with heart internet. Can i get a web page hosted with heart to access the database on … | |
Re: Has it occurred to you that you have a fairly unique situation that we may not have an easy or immediate answer for? In my experience, the people here are VERY helpful when they can be. | |
Re: Thanks for the info and for posting niek_e. I thought I'd provide an update... Since un-subscribing, and sending the PM, I've received 2 more notifications (about 15-mins apart). So obviously the un-subscribe didn't fully take. | |
Re: I'm really new to C++ as well, so I don't know how to establish the actual link to a library yet. What I do know is that what you are looking for is a header file designed for your library. In C++, "header" files (*.h files) contain various function declarations, … | |
Re: [QUOTE=fadia;1095011]Still facing the same problem. The output is not returning anything ! I just enter the number then I get press any key to continue... No matter what the base case is. :S Anyway I've altered the base case as you advised.. and still... :( [CODE]int decrement (int n) { … | |
Re: I'm afraid your question is a little confusing... Are you referring to the page with the "Welcome Back...", "Recently Updated...", and "New Threads..." headings? If so, all you have to do is click on the DaniWeb logo in the top left. Or do you mean going (for example) from within … | |
Re: "Call to undefined function..." means that a function's name as written does not exist. C++ is case sensitive. Have you double-checked your capitalization? Look up the sleep function in your help file for the Windows library. | |
Re: Are you referring to 'set'ter and 'get'ter functions within an object/class? | |
Re: [QUOTE=dchunt;1090806]Say i have this 10,000,000 (10 million) byte file. I want to perform multiplication,addition and few other operation on all those bytes(total of 5). And after it is done say if i want to repeat the addition and other operations on the same file like a loop,then How many such … | |
Re: I don't know much about bit manipulation yet, but I know that in this context the tokens/operators [icode]<<[/icode] and [icode]|[/icode] are "bitwise operators". [icode]operator<<[/icode] is the "left shift" operator. If x and y are 16-bit integers and x==0000000000000001 (which is 16-bit binary for the decimal value 1) and y==0000000000000000 (decimal … | |
Re: You can't use an actual case statement from a switch as a conditional. The cases are linked to the switch structure. You will need to use some other value or a flag of some sort. [code=c++] bool validInput; do{ validInput = true; //assume input is valid until invalid input detected … | |
Re: 1. Why do the prototypes [code=c++]float Square_root(int); void Base_exp(int, int);[/code] even exist? You don't call them anywhere... 2. The default signature/prototype for pow() is [icode]double pow([B]double[/B], int)[/icode]. You either need to change the type of Num1 to double or cast it to double when you use it. 3. Sort out … | |
Re: [QUOTE=Clinton Portis;1072988]I wish you luck on your endeavors.[/QUOTE] nice :) | |
Re: A couple days ago I worked on a similar problem in another language. If it is within the current scope of your class and/or personal knowledge set, the solution for my problem was to create a multi-dimensional (2-dimensional, specifically) array rather than an array for each individual quiz/exam. The first … | |
Re: I know the thread is marked "solved", but you have the only post in it... What specifically is the error? Are you calling resetAll() from any location other than the constructor? | |
Re: [QUOTE=norbert90;1062671]Using "Nested For" Loop, Write a program that prints the letter M. Thank you All![/QUOTE] We can't do your homework for you, but we can help. You need to show some effort first. Try it and post the resultant code. If it doesn't work, fine, we'll help you make it … | |
Re: [icode]istream[/icode] is the input stream base class that nearly all inputs are derived from. The class can be linked to files, hardware ports (such as USB or COM), etc... The object [icode]cin[/icode] is a special globally-scoped object/instance of the [icode]istream[/icode] class that is automatically linked to the console/keyboard. Without seeing … | |
Re: I know you're waffling between C# and C++, but I thought I'd throw this out for you. I started on FreeBASIC, you can find it at [url]www.freebasic.net[/url]. It works on DOS, Win, and *nix systems. I'm still very new to C++ myself, but I've managed to learn concepts in FB … | |
Re: Your first error is on line 555. On line 553, you redefine the identifier ChildRect to mean nothing, was that your intent? I probably can't help beyond that, GUI building makes me dizzy. | |
Re: [QUOTE=sfurlow;1038231] <...snip...> How do I go about doing this? I created a text file with the example information in it, but how do I import this into the project?[/QUOTE] Use an input file stream ([icode]ifstream myFile(MASTER_FILE_NAME);[/icode]) to read the information into your program and process it accordingly. | |
Re: You use [icode]ofstream[/icode] to create an OUTPUT file stream. You use this if you want to write to a file. To read from a file into your program, you need an INPUT file stream, so you want to use [icode]ifstream[/icode]. Change [icode]ofstream myfile;[/icode] to [icode]ifstream myfile;[/icode] Also, you are attempting … | |
Re: Try initializing [icode]found[/icode] to false instead of true. Also, since SIZE is a global constant, you shouldn't need to pass it to your function. It's automatically available, you can just use it. | |
Re: [QUOTE=Ponomous;1036724]Hi, So i have written my code to solve the quadratic equation and it works. The thing I need to do is to read values for 3 variables from an input .txt file until the end of the file and output the answers for each set of variables. The variables … | |
Re: If you want the Atk, Def, monAtk, and monDef variables to randomize for each iteration of the loop, you will have to calculate them inside the loop. Currently, you calculate them before the loop starts and you have no way to get back to them to re-calculate them. | |
Re: [QUOTE=restrictment;1034837]Hello, I am trying to make an rpg, and I am having troubles with functions. I am currently working on the 'potion' aspect of my rpg, which I have highlighted in red. My question is this: Is it possible to make the function return money, potion number, potion size, etc? … | |
Re: What I can see looks correct. What is the error you're getting? Also, please use code tags, it makes it easier to read. |
The End.