15,300 Posted Topics

Member Avatar for openuser

I downloaded the source and tried to compile as a C program using Visual C++ 2005 Express. Lots of compile errors, probably all of them are solvable if you are alreay comfortable with C language. Don't expect to use that code as-is -- you will have to make code changes …

Member Avatar for Ancient Dragon
0
840
Member Avatar for TylerSBreton

[QUOTE=TylerSBreton;283484]Is there a way to recognize when a key is pressed in 32-bit masm? I know you can use interrupts in 16 bit, but how can this be done using 32-bit, since 32-bit is protected by the OS. Thanks, Tyler S. Breton[/QUOTE] I haven't use [URL="http://msdn2.microsoft.com/en-us/library/ms646267.aspx"]these functions[/URL] in assembly language. …

Member Avatar for JeanChenYu
0
681
Member Avatar for MidiMagic

Might be the settings on your computer. On my computer that text is very light grey letters, somewhat difficult to see. But I can understand how some people with sight problems might find it hard to distinguish between the light grey text and normal text.

Member Avatar for MidiMagic
0
363
Member Avatar for complete

Here is a simple example of a union [code] union items { short apples; long oranges; float amount; }; [/code] your program, not the compiler, is responsible for making sure the items in the union are referenced correctly. If you instantiate an object of type items and set amount to …

Member Avatar for Ancient Dragon
0
104
Member Avatar for jenymaru08

remove the semicolon at line 13 >>e.g i input number 5,the fibonacci value of 5 is 3(right) Not unless you made a typo. The [URL="http://en.wikipedia.org/wiki/Fibonacci_number"]Fibonacci[/URL] number is the sum of the two previous numbers in the sequence. such as 0, 1, 1, 2, 3, 5, 8, 13, 21, 34, 55, …

Member Avatar for Ancient Dragon
0
94
Member Avatar for raj1324

[QUOTE=raj1324;373174]can someone give idea how to get compilrrs free or by payingfor cpp[/QUOTE] If you use MS-Windows operating system you can get Dev-C++ from [url]www.bloodshed.net[/url]. Otherwise if you use *nix you can get gcc and g++ from [url]www.gnu.org[/url]. Both are free.

Member Avatar for Ancient Dragon
0
98
Member Avatar for addicted

>>i always think that a good programmer is not suppose to take that much time to complete the program :D I whish that were true --

Member Avatar for adotl
0
111
Member Avatar for radskate360

If you want to save to a file why are you using an input file ifstream? All you need is the output file ofstream, something like this: [code] ofstream outdata("PayrollTaxes.txt"); <snip> outdata << left << setw (22) << "Federal Tax " << right << setw(14) << federal << "\n"; [/code] …

Member Avatar for Ancient Dragon
0
101
Member Avatar for srinath.sec

Most system calls are also library functions because the compiler needs the libraries in order to resolve functions at link time. There are a few exceptions, but very rare.

Member Avatar for Ancient Dragon
0
100
Member Avatar for Savage221

As explained here MS-Windows does not support TSRs. But you might be able to do what you want by writing that is called Windows Hook , which allows you to write a program that hooks into a device driver such as the keyboard driver.

Member Avatar for Savage221
0
84
Member Avatar for Dani

[quote=Narue;360140] >And of course, you can also disable avatars in posts Perish the thought. :-O p.s. It [B]is[/B] a great deal faster. Thanks! :)[/quote] Necessary at times -- especially in C++ board where class scope :: operator will sometimes turn into a smiley face

Member Avatar for MidiMagic
0
228
Member Avatar for Ancient Dragon

I'm seeing two tooltip windows for the same thread. See thumbnail. The grey one on top disappears after a few seconds.

Member Avatar for MidiMagic
0
76
Member Avatar for applegrew

Q2: Yes -- there are lots of places that look like memory leeks -- line 24: where is that object deleted? lines 13, 20, and 63: does parse() return a char pointer that needs to be deleted? If it does, then these lines are memory leeks too.

Member Avatar for applegrew
1
1K
Member Avatar for Covinus

Your program should probably call UpdateWindow() to force the WM_PAINT message to be put into the message queue. Have you read [URL="http://msdn2.microsoft.com/en-us/library/01c9aaty(VS.80).aspx"]MSDN OnPaint description[/URL]?

Member Avatar for Covinus
0
144
Member Avatar for Brent.tc

>> need to learn how to multitask in c++. Its called multi-threading. [URL="http://www.google.com/search?hl=en&safe=off&q=create+thread&btnG=Search"]Here[/URL] are more information.

Member Avatar for iMalc
0
201
Member Avatar for The Dude

[quote=jwenting;364472]last meal for condemned criminals, waste of food... In fact any expense on their behalf is wasted. Arrest them at dawn, convict them at noon, deny their appeal at dusk, and hang them next dawn.[/quote] Are you sure you're not American? I though we were the only ones who thought …

Member Avatar for jbennet
1
431
Member Avatar for sofianos

how to create an archive depends on the compiler you are using. *nix compilers normally use the [URL="http://unixhelp.ed.ac.uk/CGI/man-cgi?ar"][b]ar[/b][/URL] program. structures are not put into archives, which contains only compiled object code. Put the structure in a header file that can be easily accessed by any *.cpp or *.c file that …

Member Avatar for sofianos
0
112
Member Avatar for Dani

I don't like color in people's posts -- its too distracting. If I want to emphasize someting I normally make it [B]bold[/B] or [I]italic[/I] or both. Only in very rare occations will I use [COLOR=red]RED[/COLOR] when posting/correcting C/C++ code and then only to show suggested changes.

Member Avatar for Dani
0
846
Member Avatar for johngalt

what compiler are you using? I just compiled with VC++ 2005 Express and got no such error message, although I did get several others because you tried to make the return value of sizeof operator negative. Just typecase sizeof to return int and that corrects that problem.

Member Avatar for Ancient Dragon
0
96
Member Avatar for satyanarayanam

what are the errors ? Your sizeOf function doesn't work because it will always return 1. The standard C/C++ sizeof() is an operator not a function and evaluates the object at compile time, not runtime. To my knowledge there is no way to duplicate it in C. In C++ I …

Member Avatar for Narue
0
161
Member Avatar for Zay

If you are using MS-DOS or MS-Windows and writing a text program (not a windows program) then the output goes to the command prompt window just like it does in all other text programs. If you are writing a windows program then the text output will go into the bit …

Member Avatar for Ancient Dragon
0
89
Member Avatar for eeeraser

If you are talking about MS-DOS or the MS-Windows command prompt window, there is no other way to do it. You will have to use graphics mode to display different fonts, and in assembly that would be a huge task.

Member Avatar for Ancient Dragon
0
87
Member Avatar for quintoncoert

>>where do I write the include commands for these header files Not sure what you mean by that. Do you mean [inlinecode]#include <myheader.h>[/inlinecode] ? >> instantiate the headers Headers are not instantiated. Only objects and POD (Plain-Old-Data) are. So again, I don't know exactly what you are saying. Maybe post …

Member Avatar for Ancient Dragon
0
306
Member Avatar for nkhosinathie

start loop that counts from 0 to 100 print first question ask for answer repeat above for each question end of loop [quote] what is your gender 1. m if male 2.f if female 3.h if hetero [/quote] hetro is not a gender -- its a sexual preference. So only …

Member Avatar for Ancient Dragon
0
2K
Member Avatar for jenymaru08

>>this is the code i use but an error occur what is (are) the error(s) ?

Member Avatar for meiyantao
0
180
Member Avatar for louis7370
Member Avatar for socom(psp)

I don't see anything wrong with it. Maybe its just your eyes, or maybe they fixed it.

Member Avatar for sk8ndestroy14
0
123
Member Avatar for snickers6226

[QUOTE=snickers6226;368285]so can you help me?[/QUOTE] The problem is in the makefile. Since you didn't post it nobody here is going to be able to help you. maybe that makefile was not written for your compiler? You have to read its docs from whereever you got it.

Member Avatar for Salem
0
94
Member Avatar for IwalkAlone

>>you can call the function at any point of the program that may, or may not be recursion. recursion happens only when the function is called somewhere within the same function. For example [code] void foo() { <snip> foo(); } [/code]

Member Avatar for IwalkAlone
0
143
Member Avatar for StrangeLoops

Short answer: learn them all. Note: Forget about VC++ 6.0 -- its ancient and rarely used except for maintenance of old programs. [quote] Visual Studio 2005 Professional Visual Studio .NET 2005 Professional (or 2003 Pro) Visual Basic 2005 Express Edition [/quote] These are all variations of the same compiler. also …

Member Avatar for jbennet
0
192
Member Avatar for rapperhuj

>>some causes of segmentation fault Just a few: (1) attempt to execute a program that does not compile correctly. Most compilers nowdays do not produce the executable when there are compile errors, but I have seen a few compilers do that in the past. (2) buffer overruns (3) using uninitialized …

Member Avatar for Ancient Dragon
0
107
Member Avatar for christina>you

[QUOTE=Duki;366482]this could be true, and probably is true. but it could be the message we send that does the most good. [/QUOTE] you are just kidding yourself if you think that will do any good. Its been tried before and nothing at all happened to gas prices. Big oil companies …

Member Avatar for 'Stein
0
559
Member Avatar for squinx22

put them all in the same directory as main.cpp. The compiler default is to put them in the current working directory. You can confirm that yourself by compiling a program then listing out the files in that directory.

Member Avatar for squinx22
0
100
Member Avatar for venuaccha

All arrays, including multi-deminensional arrays, are passed by address, never by value. Passing a 2d array is similar to 1d array, the sedond deiminsion is optional. [code] void foo(int array[10][10]) { // blabla } or void foo(int array[10][]) { // blabla } int main() { int array[10][10]; // now pass …

Member Avatar for Salem
0
838
Member Avatar for ajaxjinx

use a stucture, like this [code=c] struct num { unsigned short v1: 4; }; int main() { num var; var.v1 = 5; printf("%d\n", var.v1); return 0; } [/code]

Member Avatar for ajaxjinx
0
194
Member Avatar for hackerbox

Sorry, we do not do people's homework for them. You need to post the code that you wrote, post error messages your compiler yelled at you, and ask questions.

Member Avatar for Ancient Dragon
0
39
Member Avatar for quintoncoert

you don't compile header files, only *.cpp and *.c files. you can list all the *.cpp files on the same line if you want or compile and link them separately. Doing this from the command line is messy, but feasable. You have to learn all the switches -- there are …

Member Avatar for Ancient Dragon
0
157
Member Avatar for nkhosinathie

what do you mean by [b]tertiary[/b] ? It has[URL="http://www.thefreedictionary.com/tertiary"] several meanings[/URL], including the [URL="http://en.wikipedia.org/wiki/Tertiary"]age of dinosaurs[/URL], or [URL="http://encarta.msn.com/dictionary_/tertiary.html"]chemestry, or the third of something[/URL]. I can only assume you mean it to be the third of something, but you used it twice in the description of the program. what is the …

Member Avatar for nkhosinathie
0
113
Member Avatar for ghadahelal
Member Avatar for WaltP
0
219
Member Avatar for rockthrower

Line 3 can be deleted because the stream's extraction operaotr >> will ignore all white space (spaces and tabs) between words. Line 4: you don't want to use getline() here because it reads the entire line, not just the next two words. If the name is always in the format …

Member Avatar for WaltP
0
245
Member Avatar for Covinus

[URL="http://msdn2.microsoft.com/en-us/library/aa923834.aspx"]InvalidateRect[/URL]

Member Avatar for Covinus
0
76
Member Avatar for MarzenaM

c++ has a sort() function, all you have to write is a comparison function. [URL="http://www.codeproject.com/vcpp/stl/stdsort.asp"]Here is a short tutorial[/URL] If you want to keep all the code you have already written, just replace the array with a vector, then call the vector's resize() method to initialize it to contain 10 …

Member Avatar for Lerner
0
112
Member Avatar for kissiwat

>>fflush (0); That is non-standard, should be [inlinecode]fflush (stdout);[/inlinecode]. Any attempt to use fflush() on an input stream like stdin will result in undefined/unpredictable behavior.

Member Avatar for Ancient Dragon
0
183
Member Avatar for somita1

You will have to post your code because it is kind of hard for me to see your monitor :) And don't [URL="http://www.daniweb.com/techtalkforums/thread78420.html"]double post[/URL]

Member Avatar for ithelp
0
75
Member Avatar for amitmistry_petl

You don't use [b]SendMessage()[/b] to post to a different thread -- use [URL="http://msdn2.microsoft.com/en-us/library/ms644946.aspx"]PostThreadMessage()[/URL] instead

Member Avatar for Ancient Dragon
0
318
Member Avatar for MarzenaM

[QUOTE=minigweek;365934]Circumference of a Triangle ? WTF !!! [/QUOTE] Didn't you learn anything in school -- its a tringle with rounded corners:)

Member Avatar for WaltP
0
255
Member Avatar for somita1

If you use c++ ifstream or fstream class you can use getline() to get the entire line [code] ifstream in("filename"); std::string line; while( getline(in,line) ) { // blabla } [/code]

Member Avatar for Ancient Dragon
0
130
Member Avatar for Duki

Is it possible for the popup to show the last post in the thread instead of the first post ? Or make it an option in CP? Often I'm more interested to read the last post.

Member Avatar for Ancient Dragon
0
109
Member Avatar for louis7370

you will have to be a little more specific. Do you get compile errors? If yes, that are the errors?

Member Avatar for Salem
0
138
Member Avatar for dcc

[quote=dcc;362027] My contention is that teens aren't bad drivers, but they are inexperienced drivers. The sad truth statistically is that the largest amount of teen deaths is because of automobile accidents, and most of these accidents are related to speeding. [/quote] That makes anyone a [I][B]bad driver[/B][/I]. A [B]good driver[/B] …

Member Avatar for socom(psp)
0
755

The End.