1,118 Posted Topics

Member Avatar for zandiago

[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, …

Member Avatar for zandiago
0
259
Member Avatar for phylon

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.

Member Avatar for Duoas
0
68
Member Avatar for rogenie

[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 …

Member Avatar for Duoas
0
943
Member Avatar for ComputerLand

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 …

Member Avatar for Duoas
0
152
Member Avatar for cloudet

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.

Member Avatar for Ancient Dragon
0
5K
Member Avatar for Narue

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 …

Member Avatar for Duoas
2
178
Member Avatar for Duoas

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, …

Member Avatar for Duoas
0
973
Member Avatar for purifier

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( …

Member Avatar for Duoas
0
125
Member Avatar for evios

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 …

Member Avatar for Duoas
0
120
Member Avatar for DemonSpeeding

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 …

Member Avatar for Duoas
0
152
Member Avatar for Rhals

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 …

Member Avatar for Duoas
0
73
Member Avatar for tracethepath

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. …

Member Avatar for Narue
0
2K
Member Avatar for danl11

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 …

Member Avatar for Duoas
0
96
Member Avatar for Evil_Tim
Re: Help

Probably not. What you want to do borders on illegal. For just a player, take a look at the mediaplayer component. Good luck.

Member Avatar for Duoas
0
39
Member Avatar for erizy

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 …

Member Avatar for Duoas
0
124
Member Avatar for samernic

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 …

Member Avatar for Duoas
0
105
Member Avatar for cms271828

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 …

Member Avatar for Duoas
0
143
Member Avatar for Acidburn

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.) …

Member Avatar for Duoas
0
122

The End.