1,118 Posted Topics

Member Avatar for meba

Use the [B]FMUL[/B] opcode. See [b]80x87 Instruction Set[/b] [URL="http://www.deec.uc.pt/~jlobo/tc/opcode_f.html"]HTML[/URL] [URL="http://home.zcu.cz/~dudacek/SOJ/manualy/80x87set.pdf"]PDF[/URL] Hope this helps.

Member Avatar for Duoas
0
48
Member Avatar for xyzt
Member Avatar for Duoas
0
93
Member Avatar for scream2ice

If all you want is teletype output (like you get on the console, without any fancy graphics or fonts or etc) you can open the PRN or LPT1 device: [code=C++] #include <fstream> #include <iostream> using namespace std; int main() { ofstream printer( "prn" ); if (!printer) { cout << "fooey!\n"; …

Member Avatar for Duoas
0
1K
Member Avatar for Dionysus

If you are looking to port Win32 API code to Linux, take a look at [URL="http://www.winehq.org/"]Wine[/URL].

Member Avatar for Duoas
0
320
Member Avatar for michinobu_zoned

[URL="http://www.cplusplus.com/forum/unices/2047/"]Here's my response to a similar question (on another forum)[/URL]. Hope this helps.

Member Avatar for Duoas
0
105
Member Avatar for waldchr

I've never used Dev-C++, but it should have a Windows MediaPlayer component that you can drop on your application, and use it to play the MP3. You can also google "msdn media control interface" for the APIs you can use to manipulate media devices on Windows. Good luck.

Member Avatar for waldchr
0
210
Member Avatar for jessamyryan

You'll need to call [b]Randomize[/b] at the beginning of your program, and use [b]Random[/b] to generate each number. [inlinecode]number := random( 45 ) +1;[/inlinecode] generate random number in 1..45 You'll also have to decide how to store each lotto sequence. For example, a 6/45 sequence might be: [code=Pascal] type LottoNumber …

Member Avatar for alvisonhunter
0
1K
Member Avatar for Bitto11

This is an issue with DOS BOX, not C. I recommend you visit the DOS BOX forums. [url]http://vogons.zetafleet.com/index.php?c=7[/url] Good luck!

Member Avatar for Duoas
0
111
Member Avatar for mauripelto

You'll have to look through the documentation to see what you can do. Besides lines and various shapes and bitblts and text there isn't much more BGI can do. It is a [i]really[/i] old architecture, and DOS-centric. I would actually suggest playing around with [URL="http://www.libsdl.org/"]SDL[/URL]. It is more powerful and …

Member Avatar for Duoas
0
112
Member Avatar for USUAggie

I'm not sure I understand what you are trying to do in your code (it is mixing siblings and children, which would be some kind of inversion...) But if what you are trying to do is convert this: [code] +---+ | 0 |--X +---+ | V +---+ +---+ +---+ | …

Member Avatar for Duoas
0
230
Member Avatar for ff4930

Why not use the STL? Is this schoolwork? Either way, I still don't understand what you are trying to do with that function pointer. But the best place to get your head around it is to take a read through [URL="http://www.newty.de/fpt/"]The Function Pointer Tutorials[/URL]. Hope this helps.

Member Avatar for Radical Edward
0
141
Member Avatar for Alex Edwards

Whenever you hear people raging a lot about stuff like that you can almost always just ignore it. The overhead of a virtual function call is so small that you have [i]really[/i] got to be pushing the limits for it to make a difference. Hmm... here's a link to the …

Member Avatar for Radical Edward
0
1K
Member Avatar for phalaris_trip

I've seen far worse code... (and I've always gotten myself into a lot of trouble by 'complaining' about it --even when it was obvious that it was costing the company thousands of dollars in delays and workarounds). It might be worth suggesting to the prof in charge that he consider …

Member Avatar for TacklesMcCaw
0
395
Member Avatar for ar31an

Hey, this game is cooler than dirt! :) I am not sure what your requirements are -- are you supposed to make your program solve the puzzle? or are you just supposed to notice when the user has successfully solved the puzzle? You have, BTW, a conflict in your data. …

Member Avatar for ar31an
0
142
Member Avatar for delixir

You need to turn the computer off and think about how to solve the problem before you confuse yourself with any more code. There is too much of it. Here are some hints. [list] [*]A 3x3 grid can be solved by placing the numbers 1 through 9 in it [i]in …

Member Avatar for DigitalPackrat
-1
300
Member Avatar for cecyl

That macro invites death without warning. If you want to swap something, #include <algorithm> and use [B]std::swap[/B](). @[b]cecyl[/b] Generic algorithms will work just fine, but if you know something about the probable distribution of your data then you can reduce sort time considerably. If you know that you have a …

Member Avatar for vijayan121
0
128
Member Avatar for Misha_CZ

It sounds like you are out of luck. If you have been absent for valid reasons (medical emergency, death of immediate family member, etc) many Universities will require the professor to give you reasonable accommodations to make-up the work which you have missed. I would add that your assignment is …

Member Avatar for Duoas
0
79
Member Avatar for zoner7

The [b]char[/b] datatype is not guaranteed to be stored in a single byte, either. I would also like to expand somewhat on [B]Ed[/B]'s response. Typically you don't want to [i]directly[/i] print your data, but you want to [i]transform[/i] it when you read and write it. That's what [b]cin[/b] and [b]cout[/b] …

Member Avatar for Radical Edward
0
530
Member Avatar for driplet

Wrong forum. This is the C++ forum. Binary I/O is straight-forward, but you need to be aware of certain caveats. You never list the types of [B]result[/B] and [B]rest[/B], but if they are different types then you are playing with fire. You should also be aware of endianness issues and …

Member Avatar for driplet
0
121
Member Avatar for zeropulse

The problem is that you are trying to multiply [I]strings[/I], which you cannot do. Remember, the [I]string[/I] '12' is different from the [I]number[/I] 12. So, you must first convert the PARADATA strings into numbers, multiply them together, then convert the resulting number back to a string, which you can print. …

Member Avatar for stefannn
0
223
Member Avatar for monxxx

The [B]swap[/B] function is provided for backwards compatibility only. It cannot handle [B]integer[/B]/[B]cardinal[/B] sized types. It can only handle [B]smallint[/B]/[B]word[/B] (16-bit) values. You might want to write your own versions of swap.

Member Avatar for Clive29
0
268
Member Avatar for gilcimar

Usually a TSR will override one of the user interrupts (like $60) so that you can communicate with it (and, for example, tell it to stop). If I remember correctly, once you load a TSR you cannot unload it, but you can disconnect it by restoring the interrupt vectors to …

Member Avatar for Duoas
0
119
Member Avatar for daviddoria

Your [B]Vector3[/B] is missing the appropriate copy constructor. A good rule of thumb is if you use any one of copy constructor, assignment operator, or virtual destructor, then you need all three. (Not always, but usually.) Hope this helps.

Member Avatar for Duoas
0
1K
Member Avatar for Adz52

Are you using [B]Delphi[/B] or [B]Pascal[/B]? (It makes a difference.) All binary trees are just a fancy form of linked-list, so there is no reason why you can't include a string in your node record. In Delphi: [code=Delphi] type pNode = ^tNode; tNode = record word: string; left, right: pNode …

Member Avatar for Duoas
0
332
Member Avatar for gerhardjl

Here's a link all about it: [URL="http://www.daniweb.com/forums/thread103675.html"]Tutorial: Handling Dates and Time in Delphi[/URL]. For D5 all the date-time stuff is in the [B]System[/B] unit. The [B]DateUtils[/B] unit first appeared in D6. While there are some extra-friendly functions there, it isn't anything you really can't do without. You can either write …

Member Avatar for gerhardjl
0
1K
Member Avatar for glindhot

I'm really not sure I understand the question, but as it has been five days I figure I'll give it a shot... :-/ If it is just a matter of mixing whole games and half games, convert to the lowest common denominator: half games. So for every whole game from …

Member Avatar for glindhot
0
135
Member Avatar for brk235
Member Avatar for Duoas
0
119
Member Avatar for ff4930

Heh, that was an interesting thread... Yes, there is a simple, one-shot way to do it using the STL, but it is fairly advanced stuff (though I don't know why) :twisted: Here's a little program to demonstrate it. [code=C++] #include <algorithm> // for copy() #include <iostream> // cin, cout #include …

Member Avatar for Duoas
0
171
Member Avatar for pwnz32

Two things: 1) [b]char[/b] is not the same as [b]char*[/b]. The first is a single character. The second is an address to one or more characters (like an array). Your function should take the second as argument. 2) The function prototype lists an argument, but the function itself never names …

Member Avatar for pwnz32
0
3K
Member Avatar for cam9856

You'll want to play with [URL="http://www.masm32.com/"]MASM32[/URL]. It has everything you need. Good luck!

Member Avatar for cam9856
0
95
Member Avatar for daviddoria

Eh, I understand. You solved it. Your makefile looks fine to me. I usually write my makefiles by hand as well. However, for large projects people will tend to some sort of program like [URL="http://www.gnu.org/software/automake/"]automake[/URL] or [URL="http://www.scons.org/"]scons[/URL] or some other like tool to manage all the dependencies in your project …

Member Avatar for Duoas
0
158
Member Avatar for e_pech

I'm not sure I understand your question. OpenGL programs only have one screen/view. Do you mean that you want to draw to someplace other than the OGL window?

Member Avatar for Duoas
0
250
Member Avatar for daviddoria

I disagree. I think that [b]getline[/b]() is one of those under-valued little functions that make simple parsing like this a breeze. But like [B]VD[/B] said, you must use it on a stream. You actually almost have it already. [code=C++] vector <int> parse_date( string date ) { vector <int> result; stringstream …

Member Avatar for Duoas
0
146
Member Avatar for wellibedamned

I don't want to obnoxiously barge-in to this thread, but the STL allows you to do a lot of this stuff automatically. [code=C++] #include <algorithm> #include <iostream> #include <iterator> #include <limits> #include <deque> #include <string> using namespace std; int main() { deque <double> numbers; // Use the STL to read …

Member Avatar for wellibedamned
0
211
Member Avatar for kux

Do you mean you have something like this: [code=C++] class Foo { private: Baz* baz; // <-- This gets shared between instances. // It will cause problems... (See the destructor!) public: Foo(): baz( new Baz ) { } Foo( const Foo& foo ): baz( foo.baz ) { } ~Foo() { …

Member Avatar for Duoas
0
117
Member Avatar for iansane

(Sorry, I've got a splitting headache so I haven't really looked at your code...) For a CSV file you know that the headers are there. If you load all lines into the vector then it is easy to delete them before saving again. (While a vector works fine for this, …

Member Avatar for Duoas
0
142
Member Avatar for Crushyerbones

While the libraries are non-portable, don't worry too much about using _kbhit() or some other like function. If you [i]do[/i] need to port someday, it is trivial to implement it in terms of the new platform. While [b]jephthah[/b] is correct that you are better off just learning to do it …

Member Avatar for Duoas
0
192
Member Avatar for herms14

I think your professor means he wants you to search the array with 100 randomly generated numbers (a new random number to find for each search). The only meaning I can get out of sequential search is just what you'd expect an unordered search to look like: does elt 0 …

Member Avatar for n1337
0
106
Member Avatar for Agni

For all those graphic characters you are completely at the mercy of the terminfo database, which is often enough incomplete in that respect. I typically just set the graphic characters to a nice combination of minus, pipe, and plus (-, |, +) in my initialization code.

Member Avatar for Duoas
0
117
Member Avatar for jsosnowski

I've not had that problem. I also don't see how you can get it when I look through Variants.pas. Are you sure the file isn't damaged in some way? (Like missing an [b]end[/b] or somesuch?)

Member Avatar for Duoas
0
155
Member Avatar for &rea

Depending on how the data is packed. If it is packed (MSB...LSB) ARGB then [code=C++] int alpha = (color >> (3 * 8)) & 0xFF; int red = (color >> (2 * 8)) & 0xFF; int green = (color >> (1 * 8)) & 0xFF; int blue = (color >> …

Member Avatar for Duoas
0
169
Member Avatar for fedderico10

This is the reason I think making typedefs to pointers is a bad idea... It looks like you did the right thing, but the compiler is saying that the [B]xmlDoc[/B] class does not publish a method named [b]leerEntrada[/b](). It looks like you are including the correct files (since the compiler …

Member Avatar for fedderico10
0
662
Member Avatar for joekim

I'm not sure I understand your requirements. Is this a homework assignment to use lists? Or is this work-work? Do you have an existing database or do you have to design it? How does the database update (synchronize with warehouse stock)? What do lists have to do with it? Is …

Member Avatar for Duoas
0
67
Member Avatar for Jennifer84

You need to write the comparitor. [code=C++] #include <sstream> #include <string> struct mysort { bool operator () ( const std::string& a, const std::string& b ) { std::stringstream as( a ); std::stringstream bs( b ); double ad, bd; as >> ad; bs >> bd; return ad < bd; } }; [/code] …

Member Avatar for Jennifer84
0
418
Member Avatar for lahom

[B]DialogA[/B] is in a separate exe than [B]DialogB[/B]? You will need to play with the STARTUPINFO structure when you call [B]CreateProcess[/B](). Either that or just set both dialogs to center themselves on the screen or on their parent when they are used. Hope this helps.

Member Avatar for mitrmkar
0
335
Member Avatar for grommet2481

The best way to deal with console text alignment issues is to get out a piece of graph paper and a stylus and draw what you want it to look like. Then you can count things out so that they always match. As for the CSV stuff, give me a …

Member Avatar for Sky Diploma
0
92
Member Avatar for asianguyjtran

[URL="http://www.cplusplus.com/forum/unices/2047/"]Link[/URL]. Check my last three posts for code. Enjoy!

Member Avatar for asianguyjtran
0
100
Member Avatar for discus815
Member Avatar for suxxor

You can push and pop it. 1. Call function first time. Answer is in EAX. 2. Push EAX. 3. Call function second time. Answer is in EAX. 4. Pop EBX (or register of your choice). Answer to first function call is in EBX. Answer to second function call is in …

Member Avatar for suxxor
0
89
Member Avatar for buddy1

Recursion gets people because it is something new --which translates to forgetting all the stuff you already know. In order to determine the maximum number in a list, you need three things: 1. the list 2. the current maximum value 3. something to compare each element of the list with …

Member Avatar for Duoas
0
109

The End.