15,300 Posted Topics
Re: 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 … | |
Re: [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. … | |
Re: 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. | |
Re: 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 … | |
Re: 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, … | |
Re: [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. | |
Re: >>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 -- | |
Re: 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] … | |
Re: 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. | |
Re: 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. | |
Re: [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 | |
I'm seeing two tooltip windows for the same thread. See thumbnail. The grey one on top disappears after a few seconds. | |
Re: 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. | |
Re: 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]? | |
Re: >> 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. | |
Re: [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 … | |
Re: 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 … | |
Re: 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. | |
Re: 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. | |
Re: 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 … | |
Re: 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 … | |
Re: 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. | |
Re: >>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 … | |
Re: 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 … | |
Re: >>this is the code i use but an error occur what is (are) the error(s) ? | |
Re: line 140 -- replace the dot with a space to declare an object. ![]() | |
Re: I don't see anything wrong with it. Maybe its just your eyes, or maybe they fixed it. | |
Re: [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. | |
Re: >>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] | |
Re: 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 … | |
Re: >>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 … | |
Re: [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 … | |
Re: 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. | |
Re: 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 … | |
Re: 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] | |
Re: 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. | |
Re: 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 … | |
Re: 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 … | |
Re: 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 … | |
Re: [URL="http://msdn2.microsoft.com/en-us/library/aa923834.aspx"]InvalidateRect[/URL] | |
Re: 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 … | |
Re: >>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. | |
Re: 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] | |
Re: 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 | |
Re: [QUOTE=minigweek;365934]Circumference of a Triangle ? WTF !!! [/QUOTE] Didn't you learn anything in school -- its a tringle with rounded corners:) | |
Re: 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] | |
Re: 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. | |
Re: you will have to be a little more specific. Do you get compile errors? If yes, that are the errors? | |
Re: [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] … |
The End.