1,118 Posted Topics
Re: [B]First[/B]: Only include stuff you need. Go ahead and get rid of everything except [B]iostream[/B]. (You don't use any I/O manipulators, you don't use any C math functions, you don't read or write to files, and you don't use any [B]std::string[/B]s.) [B]Second[/B]: This point probably isn't obvious at first glance, … | |
Re: Heh, you've really gotten yourself into a pile of beans. The inverse is the [B]adjugate[/B] over the [B]determinant[/B]. There is no simple answer. Google those and good luck. PS. Come back with some code and we'll try to help you more. | |
Re: [B]Dave Sinkula[/B] gave you the best advice, but with the fewest words. What he meant is that there are only two numbers you need to remember every time the user enters a number: the smallest entered so far and the largest entered so far. Hence: [code] #include <cstdlib> // the … | |
Re: Wh.. what... your [I]teacher[/I] gave you that code? He should be fired. For your language questions, this is a really handy site. [URL="http://www.cppreference.com/"]http://www.cppreference.com/[/URL] Click on the part for [B]C++ I/O[/B] to find [B]putback[/B] and the like. (BTW. [I]Don't[/I] use putback in your code. If you ever actually do have to … | |
Re: The [B]open()[/B] function only takes [B]char *[/B] as an argument --it won't take [B]std::string[/B]. Say this instead: [code] infile.open( filename.c_str(), ios::in ); [/code] Hope this helps. | |
Re: Seriously! (Love your avitar!) One of the major problems I find with people (particularly, newbie programmers) is that they somehow expect the computer to solve their problems. Natural, because that is how they have used computers so far... Coding is different. It is important to remember that computers aren't just … | |
Hi all. I'm a newbie to this forum so please forgive the odd question as first post... :-) I'm writing myself a [B]property[/B] class (just because I want to play with them). My property header looks something like this (all the usual clutter is removed): [code]#define property_readwrite( c, v, r, … | |
Re: Your example is contrived, so just stick the shellcode in your first program as a function. An overflow attack works by contaminating the code segment with data. For example, if I say: [code] void do_something() { char s[ 12 ]; printf( "Enter a string> " ); gets( s ); printf( … | |
Re: Since no one has answered this... In a [B]normal branch[/B], the branch test is performed and the next opcode fetched depends on the result of the test. It might be the next opcode or it might be the opcode at the address indicated by the branch. The net result is … | |
Re: Er, when you post code make sure to place it between 'code' blocks, like this: [[b][/b]code[b][/b]] std::cout << "Hello, world!" << std::endl; [[b][/b]/code[b][/b]] which looks like this: [code] std::cout << "Hello, world!" << std::endl; [/code] I assume that [B]filename[/B] is a [B]std::string[/B] and [B]outdata[/B] is a [B]std::ostream[/B]. The stream classes … | |
Re: Your problem is that your input is variable. You can enter one of: [code] number operator number number operator [/code] However, your code only permits the second type of input: [code] cin >> first >> second >> op; [/code] I'll give you a hint: don't use [B]int[/B] variables as the … | |
Re: The problem is so simple you'll laugh... Your loop says: [code] while there is no file failure (eof): abc <-- read next record display abc [/code] What happens is this: Read record one (no file read failure), display record one. Read record two (no file read failure), display record two. … | |
Re: Sounds like you have to write a program that takes a user-supplied number (like $132.17) and turn it into cash. This is an easy homework problem you should be able to do yourself. But here's a hint: start by subtracting the large denomination bills first and work your way down … | |
Re: Probably not. What you want to do borders on illegal. For just a player, take a look at the mediaplayer component. Good luck. | |
Re: In short: no. If I understand your question properly, what you want to do is execute all the code in the [B]try {...}[/B] block before the exception transfers control to the [B]catch (...) {...}[/B] block. If that is the case, you need to reconsider how exceptions work. Anytime an exception … | |
Re: Presumably s0 and s1 are the arguments to your function... Look through and try to see what is happening to each register. I find it convenient to get out the crayons and construction paper and make little boxes with the values of each register in it (seriously). The result is … | |
Re: You are about to get more information than you bargained for... :icon_cheesygrin: On Windows systems, an EXE file has a tag in its header that declares whether or not to start it as a Console process (using the DOS window) or as a GUI process (without the DOS window). Programs … | |
Re: The problem isn't with adding or deleting nodes, it is with using the [B]operator <<[/B]. When you say [code]cout << iteratorNode->data << endl;[/code] you need to be aware of what type of data [B]data[/B] is. If it is a simple type ([B]int[/B], [B]float[/B], etc.) or a predefined type ([B]std::string[/B], etc.) … |
The End.