1,118 Posted Topics

Member Avatar for apuM

Forget Java. If you can do it in C you can do it in MIPS. Remember, a power of two is a number that has only [I]one[/I] bit set (all the rest are zeroes), and that bit cannot be bit 0 (the least-significant bit). Your C solution looks fine. In …

Member Avatar for Duoas
0
208
Member Avatar for matt999tye

Shift "forgets" the bits shifted out. Roll takes the bit shifted out and sticks it back in on the other end. Examples: [code] 01101010 start (one byte) 11010100 shifted left by one 10101000 shifted left by one 01010000 shifted left by one etc. [COLOR="Red"]0[/COLOR]1101010 start (one byte) [COLOR="Green"][B]1[/B][/COLOR]101010[COLOR="Red"]0[/COLOR] rolled left …

Member Avatar for Duoas
0
132
Member Avatar for vectra17

Yes, but you need to know something about how to create components and interfaces. [URL="http://delphi.about.com/od/comoleactivex/OLE_COM_DCOM_Automation_ActiveX_Delphi_knowledge_base.htm"]I think this page on About.com should get you started[/URL]. It is possible someone already wrote a Delphi interface unit for the COM object you want to use. I would spend a little time on Google …

Member Avatar for vectra17
0
76
Member Avatar for Olsi009

I think that you need to increase your stack size. You can do it from the [B]Options -> Compiler -> Memory Sizes[/B] menu or use the $M directive at the top of your code. [code=Pascal] {$M 32768, 655360} { Twice the default stack size, default heap size } program fooey; …

Member Avatar for brijkiran
0
206
Member Avatar for SergioQ

There is no function (AFAIK) that allows you to hook every thread in a single process at once... I would add the hook as part of the new thread startup procedure (either by the caller when creating the thread or just as the first thing the new thread does). Good …

Member Avatar for Duoas
0
63
Member Avatar for kylcrow

If it is core-dumping you still need to potty-train it. Google "linked lists" and read more to learn how to fix your problems. (They are all caused by an improperly-coded linked list.) Also, your setHead() method is [I]very[/I] dangerous: you should not have methods that let things outside your class …

Member Avatar for Ancient Dragon
0
317
Member Avatar for behnaz

Actually, the folks at <whoever owns borland nowdays> have brought back the "Turbo" moniker... So if you go download [URL="http://www.turboexplorer.com/cpp"][B]Turbo C++ [I]Explorer[/I][/B][/URL] you wouldn't have to resort to BGI graphics at all... JSYK.

Member Avatar for Duoas
0
160
Member Avatar for sony112

As you can see from the number of postings about this so far, quite a few people have been working on this. I have seen two text-only, ASCII-art versions, and one windows application using images. Add a "7-segment" font to that repertoire and you have a lot of choices...

Member Avatar for sura17
0
92
Member Avatar for fgn89
Member Avatar for Duoas
0
606
Member Avatar for angrita

Actually, for the answer to (1), you [I]can[/I] make the window text bigger by adjusting the font, but you'll need to do it in a shortcut. [list=1] [*]Create a shortcut that starts your gwbasic application. [*]Use the shortcut to start the program. [*]Right click on the console window's menubar to …

Member Avatar for jwenting
0
183
Member Avatar for snucho
Re: Bits

Is this a trick question? (The answer depends on the machine's addressing scheme ;) )

Member Avatar for DevonMcC++
0
78
Member Avatar for gerard4143

It has nothing to do with Intel. Every OS must allocate and initialize memory for programs, no matter what chipset you are using. When the OS places your program into memory, it places the various parts in the proper places: Code goes in one place, Data goes in another, and …

Member Avatar for sanzilla
0
89
Member Avatar for afro007

In Delphi, I like the [B]FormatFloat[/B] function. If you look at the docs for it, you can also check out the "See Also" stuff.

Member Avatar for ebi1
0
2K
Member Avatar for Roebuc

Between lines 11 and 12 put [inlinecode]cin.ignore( numeric_limits<streamsize>::max(), '\n' );[/inlinecode] The stream >> operator only reads what you ask it to, and leaves everything else behind in the input buffer. However, whenever dealing with user input you must expect that the user will press the ENTER key after everything you …

Member Avatar for Roebuc
0
586
Member Avatar for afarr

Yes, it is the same. And (at least by what I see now) his code does start with [B]randomize[/B]. In computers, there is no such thing as a truly random number. Delphi's random number generator is notoriously wimpy. You'll have to google "[URL="http://www.google.com/search?q=delphi+random+number+generator&afid=5052&s=&search="]delphi random number generator[/URL]" or something similar for …

Member Avatar for MarioV
0
746
Member Avatar for cknapp

That shouldn't work at all. Both [B]upgraph[/B] and [B]downgraph[/B] are defined to take a single argument, but you are passing multiple... That could be the problem. Make sure also that you aren't calling bitset with '(). Sorry I can't be of more help.

Member Avatar for cknapp
0
198
Member Avatar for cosmos22

If by "a few degrees" you mean something other than 90, 180, or 270, then you can't (not without some fancy magic tricks). If by "a few degrees" you mean exactly 90, 180, or 270, then maybe. What OS and WM are you using? Also, what is your video hardware?

Member Avatar for mitrmkar
0
76
Member Avatar for apuM

It just moves data around. [URL="http://en.wikipedia.org/wiki/MIPS_architecture#MIPS_Assembly_Language"]Check out the Wikipedia for a pretty good opcode reference[/URL]. Also, I didn't realize you could use [inlinecode]jr $ra[/inlinecode] in main... I'll have to check that out. (Generally programs terminate using the exit syscall.) Good luck.

Member Avatar for Duoas
0
95
Member Avatar for cosmos22

There are two basic ways. First, you could simply [B]FreeConsole[/B] to get rid of the console window, then [B]AllocConsole[/B] to get a new one. Better yet though, is to use [B]ShowWindow[/B]: [code=C++] #include <string> #include <windows.h> const char STR_CONSOLE_WINDOW_CLASS[] = "ConsoleWindowClass"; std::string GetConsoleTitle() { unsigned long length; std::string result( 1000, …

Member Avatar for Duoas
0
1K
Member Avatar for torbecire

You might want to remember to load (E)DS at the beginning of your program. All the functions you are using (with 'call') have a register call type, meaning that arguments are passed in registers. Hence, to settextcolor( attribute: byte ) the attribute must first be placed in AL (as you …

Member Avatar for Duoas
0
187
Member Avatar for kux

Actually, it is possible. You need to use [B][I]token concatenation[/I][/B]. [inlinecode]#define DEFINE_FUNC( n ) void func_ ## n()[/inlinecode] You would use it in the normal way: [inlinecode]DEFINE_FUNC( 12 );[/inlinecode] The preprocessor would turn that into: [inlinecode]void func_12();[/inlinecode] While I can't imagine why you want to do this, there are, in …

Member Avatar for vijayan121
0
185
Member Avatar for cosmos22
Member Avatar for AMARJEET DUA

Usually you will have yourself a little function that takes a specific number of bits (let's say just one bit at a time for each branch in the tree). The function will modify a static "bits" variable (say, one byte) by shifting in the new bit, and incrementing another static …

Member Avatar for Narue
0
147
Member Avatar for cosmos22

You can only delete one file at a time. If you have a list of files, you can iterate through the list and delete each file in turn. [code=C++] vector<string> file_list; int num_files_not_deleted = 0; for (int i = 0; i < file_list.size(); i++) if (!DeleteFile( file_list[ i ].c_str() )) …

Member Avatar for cosmos22
0
96
Member Avatar for matt999tye

You have to call ADC after each ADD. (The carry flag is only one bit deep.) Hope this helps.

Member Avatar for Duoas
0
173
Member Avatar for marlow08

You have a couple of problems. Your "display the array" routine ([B]intarray[/B]) is perfect. Your "search the array" routine ([B]exist[/B]) should look almost exactly like it. (But it doesn't). The [B]found[/B] variables should be [B]boolean[/B]. Also, the found parameter should be a [B]var[/B] parameter. The procedure type should be: [inlinecode][B][COLOR="Green"]procedure[/COLOR][/B] …

Member Avatar for Duoas
0
74
Member Avatar for ventrica

Don't use [inlinecode]void main()[/inlinecode]. Always use [inlinecode][B]int[/B] main()[/inlinecode]. In "List.h" the Traverse() method is (incorrectly) prototyped as [inlinecode]void Traverse( DataType, int& )[/inlinecode]. In "List.cpp" it is (correctly) defined as [inlinecode][B]bool[/B] Traverse( DataType, int& )[/inlinecode]. Please don't use leetspeak or other weenie talk. (Be kind to those for whom English is …

Member Avatar for vijayan121
0
427
Member Avatar for shinchan

You'll need to track mouse down and mouse up events, then use the Pythagorean theorem. Hope this helps.

Member Avatar for debasisdas
0
240
Member Avatar for Jennifer84

Typically, your window isn't actually destroyed, it is only hidden. Hence, when you ask to show it again nothing has changed. You will need to add an OnShow event handler to reload your combobox whenever the form is displayed. Hope this helps.

Member Avatar for Jennifer84
0
106
Member Avatar for doniking

You'll need to make yourself a DLL that has the hook callback function. Google "system hook" for information. Hope this helps.

Member Avatar for Duoas
0
75
Member Avatar for sirdeity
Member Avatar for knight fyre
Member Avatar for number87

Why do you keep opening and closing your outfile? (You never do that with [B]cin[/B]...) Get rid of every line that says [inlinecode]outfile.open( ... );[/inlinecode] and every line except the last that says [inlinecode]outfile.close();[/inlinecode], and try it again. Hope this helps.

Member Avatar for mitrmkar
0
169
Member Avatar for OnIIcE

This should get you started. Please note that I've never used Borland C++ Builder, I don't have it, and I have not tested this code. I only translated the [B]EBitmapError[/B] class and the [B]RotateScanline90[/B] function set. Hope this helps.

Member Avatar for OnIIcE
0
413
Member Avatar for kunalcrazycoder

If you are on linux, check out [URL="http://ca.geocities.com/jefftranter@rogers.com/eject.html"]Jeff Tranter's eject[/URL].

Member Avatar for Duoas
0
98
Member Avatar for shrutijadhav

In particular, both Gnome and KDE are able to be used as application frameworks. [URL="http://www.gtk.org/"]GTK+[/URL] is a very common, very complete toolkit with C API bindings. Most others I know of are C++... You can also take a gander through [URL="http://www.free-soft.org/guitool/"]The GUI Toolkit, Framework Page[/URL]. Hope this helps.

Member Avatar for Duoas
0
154
Member Avatar for afro007

Both are variations on the same thing. First off, each time you [inlinecode][B]readln([/B]key[B]);[/B][/inlinecode] you change the value of [B]key[/B]. So if you ask for it three times, it will only be whatever you entered the third time. I would recommend just forgetting the [B]key[/B] and asking the user to press …

Member Avatar for Duoas
0
143
Member Avatar for matt999tye

I still have no idea why you are having the operand size conflicts. [URL="http://support.microsoft.com/kb/125799"]This is what Microsoft has to say about it[/URL]. The AX is implied in MUL operands, so the third instruction should read [inlinecode]mul num2[/inlinecode] Hope this helps.

Member Avatar for Duoas
0
111
Member Avatar for ad_ms

Glad to hear you've got it working for you. Don't feel bad when people don't reply. A lot of times it is just that no one knows how to answer your question...

Member Avatar for ad_ms
0
109
Member Avatar for mistercow.pnoy

It sounds like your teacher wants you to use a brute-force method. Just loop an integer from 1 to n and check to see if it divides evenly into your number. If it does, then it is a factor. Your choice of n can be interesting.

Member Avatar for Nemoticchigga
0
121
Member Avatar for fl00d

The compiler is mangling your function name to "C" standards. It is looking for "_hhPostMessageA" instead of "hhPostMessageA" (note the underscore). What you are doing is fairly compiler-specific, but these days a lot of them accept the [inlinecode]__declspec[/inlinecode] keyword. [inlinecode]extern "C" __declspec( dllimport ) void hhPostMessageA( HWND, UINT, WPARAM, LPARAM …

Member Avatar for 4ng3licDew
0
152
Member Avatar for DonCarmelo

I think you are out of luck. [URL="http://searchwindevelopment.techtarget.com/expert/KnowledgebaseAnswer/0,289625,sid8_gci1045901,00.html"]See here.[/URL]

Member Avatar for lissauer
0
180
Member Avatar for matt999tye
Re: Nor

You should be using [B]unsigned long[/B], not [B]double[/B]. In either case, VC++ could have a problem correctly identifying the size of the operand inside the __asm block. I don't know enough about VC++ __asm to be sure, though... It might be worth pointing your professor to [URL="http://www.masm32.com/"]MASM32[/URL]. Hope this helps.

Member Avatar for matt999tye
0
160
Member Avatar for matt999tye

[B]Nand[/B] isn't a single operation. How is [B]nand[/B] defined? That will give you your answer. If you are using x86 assembly, look at the [B]and[/B] and [B]not[/B] instructions. If you are using MIPS, you'll have to think just a little harder: [B]and[/B] and [B]xor[/B]. Good luck.

Member Avatar for Duoas
0
132
Member Avatar for buddyrocks73

[URL="http://www.cppreference.com/stdother/rand.html"]rand()[/URL] returns a value between 0 and RAND_MAX. You need to apply some math to bound that value. In C++, the remainder operator is [B]%[/B]. [inlinecode]int value = (rand() % 499) +1;[/inlinecode]

Member Avatar for Narue
0
142
Member Avatar for kedi

Your description to us is so vague that we can't really help. How exactly does your professor expect you to display a bmp? Did he provide the bmps to display? Are you using the Windows API or some other GUI framework? What sort of calculations are you doing? What does …

Member Avatar for Nick Evan
0
284
Member Avatar for sarko86

At the top of your main program (the .hsx file) you should have something like: [code=Haskell] module MyProg where import Char [/code] In this example I named my .hsx file "MyProg.hsx" but you can name it whatever you like. Make sure to import every library you need. The [B]isDigit[/B] function …

Member Avatar for sarko86
0
124
Member Avatar for nurulshidanoni
Re: Draw

Perhaps we should ask: what do you mean by a "table for matrix"? And on what medium do you want to draw it (console, gui window, printer paper)?

Member Avatar for ndeniche
0
169
Member Avatar for orangejuice2005

On lines 7 and 9 you forgot to say [inlinecode][b]p1.[/b]coef.begin()[/inlinecode], etc. Line 17 should have a [inlinecode]==[/inlinecode], not a [inlinecode]=[/inlinecode]. Your iterators have terrible names. Try iter --> icoef1 iter2 --> iexpo1 iter3 --> icoef2 iter4 --> iexpo2 This will help. Now, just remember, every time you increment an iterator …

Member Avatar for Duoas
0
2K
Member Avatar for aircraft

Remember, of course, that in C++ everything is zero-based. So [inlinecode]Value[1][10][/inlinecode] is the [I]second[/I] row and the [I]eleventh[/I] column. A vector, as [B]Jennifer84[/B] demonstrates, is a superior construct, since you get all the benefits of an array without any of the drawbacks. [EDIT] Oh yeah, almost forgot to answer your …

Member Avatar for Duoas
0
119

The End.