15,300 Posted Topics
Re: The mod operator is simply the remainder after division. For example, 4%2 is 0 because the remainder after 4/2 is 0. The mod operator works only on integers, not floats or doubles. There is no code to give you because that's all it is -- a simple 5th grade math … | |
Re: what have you tried? The first two parameters to MessageBox do not ave to be string literals, they can be pointers to strings. | |
Re: First check to see if you have to compile that library yourself, or does it already contain *.lib files that you need. Normally *.tar files were compressed from a *nix distribution, not MS-Windows. With Dev-C++ (which itself is ancient and outdated) you most likely will have to create a static … | |
Re: I once crashed the entire Unix operating system with a one-line statement:[icode]int* ptr = malloc(sizeof(int) * (MAX_INT_SIZE+1));[/icode] MS-Windows operating system today is pretty stable and won't allow a single program to crash the entire os. I haven't seen such a crash in quite a few years. | |
Re: How is the file formatted? Does it contain fixed or random length records? Binary file or text file? We have to know everything about the file before your question can be answered. | |
Re: There is a list of the top 100 members that is probably more useful than the full list because the top 100 members will include most, if not all, the active members who post here. See the "Top Members By Rank" link the very top of the page. | |
Re: >>because the compiler prints the Don't blaim the compiler for the code you wrote :) The logic of your program is flawed. scanf("%c" expects you to enter an alphabetic character, such as 'D'. The switch statement is checking for numeric data, such as 0, 1, 2, ... Since you used … | |
Re: You could replace char* name with std::string name so that you do not have to allocate any memory for that variable. If that doesn't fix the problem then the problem is caused by something else in your program, such as buffer overflow somewhere else that is destroying the heap. | |
Re: Let's say you have two *.cpp files -- A.cpp and B.cpp [icode] cl A.cpp B.cpp c. a.obj b.obj -o myprogram.exe [/icode] There are of course lots of other flags you can add but the above is the simplest. If you bother to learn VC++ 2010's integrated IDE you wouldn't have … | |
Re: One way to solve it is just before [icode]fprintf(AppendingFile, "\n");[/icode] call fseek() to move the file pointer backwards one character., such as [icode]fseek(AppendingFile,-1,SEEK_CUR);[/icode] | |
Re: I've been using Code::Blocks on 64-bit Windows 7 for some time now and with none of the problems you described. Are you reading [URL="http://gpwiki.org/index.php/SDL_ttf:Tutorials:Basic_Font_Rendering"]this tutorial[/URL]? If not then maybe you should | |
Re: >>Any idea? Yes, replace the relative path with full path to the *.lib file. You obviously have used the wrong relative path. | |
Re: your program looks ok until line 28. At that point all you have to do is sum up the three numbers on each of the 5 rows of the 2d array and display the largest sum value. You don't need GrandA, GrandB, or GrandC. just int sum and int largest_sum. | |
Re: Those functions are not defined in the files you posted so they must be in another file or library that you need to add to the solution. Look in your 32-bit project and find out where those function are found. | |
Re: >>I should get an error message and not an incorrect value. No. Its your fault, not the compiler's. A compiler can only produce erros/warnings on the code it sees at compile time. It knows nothing about runtime errors. | |
Re: Maybe he is trying to ask what kinds of operating systems are in common use??? | |
Re: I don't know what w3m is, but do you mean someting like [icode]system("w3m");[/icode]? | |
Re: You need to find out what PVOID is defined to be. If it's not defined to be anything, such as [icode]define PVOID[/icode] then the compiler will produce C4430. If you don't know what C4430 error is then look it up with google. >>HAPTIK_DLL_IMPORT_EXPORT Your program need to define that symble … | |
Re: You could do this [code] class something { public: char attribute1[25]; char attribute2[25]; donkey(char* a, char* b) { strcpy(attribute1,a); strcpy(attribute2,b); } donkey(){} }; [/code] | |
Re: You might find [URL="http://cboard.cprogramming.com/c-programming/97116-c-big-numbers-storing-them.html"]this thread [/URL]interesting and useful | |
Re: The result of that program is compiler dependent whether on *nix or any other operating system. | |
Re: lines 41 and 42 are duplicates. delete one of them. Your program has a number of errors in it -- here is a corrected copy. I changed the indentation of some loops to make it easier for me to see what it's doing -- you can just ignore my style … | |
Re: Your program compiled and ran ok for me using VC++ 2010 Express on 64-bit Windows 7. Here's the output I got, but I don't know if it's right or wrong. [icode] 1 2.5 3 3.5 3.6 5 6 7 7.9 8 8 9 10.5 12.6 14 45 Press any key … | |
Re: If you are talking about an int or float array, the answer is no because there is no such value as infinity. Integers have maximum values, which are declared in limits.h header file. | |
Re: You will want to call FindFirstFile() and FindNextFile() to get a list of all the files and folders, then display the information in a tree control. You can get examples of tree controls from [url]www.codeproject.com[/url], the largest repository of c++ code for MS-Windows on the internet. Once you are on … | |
Re: It's missing the first file because your program is tossing it into the bit bucket. findfirst() finds the first file then your program immediately calls findnext(), which dumps the result from findfirst(). You need to rearrange the logic of that funcion so that it does something with the results of … | |
Re: Look at [URL="http://winprog.org/tutorial/"]this tutorial [/URL]and maybe it will tell you what you are doing wrong. | |
Re: What is it that you are trying to do? Very doubtful that anyone here knows how to read Chinese. | |
Re: >>but the problem is once i enter '1', it ask me again the question Because yuou have the question twice in your program, once on line 43 and again on line 56. | |
Re: This makes more sense [code] bit running = 0; float var1, average_value; void is_something_running(void) { running = (fabs(var1 - average_value) <= 0.001) ? 0 : 1; return running; } [/code] | |
Re: [code] int temp; int a = 1; int b = 2; // swap a and b temp = a; a = b; b = temp; [/code] | |
Re: >>int matrixSize(ParserDVG::NodeElems.size()); That looks like a function prototype. You can't put executable code such as .size() there. | |
Re: Don't you think creating three threads for the same question is a bit much? | |
Re: single [icode]int array[10];[/icode] multidimensional: [icode]int array[10][3];[/icode] This is more like a spreadsheet where it has 10 rows and 3 columns per row. | |
Re: >>is there's anyway to output anything when the computer stops (when it ran's out of stacks ) Nope -- your program is trashed at that point. Post the function you are attempting to write, and tell us the compiler and operting system. | |
Re: anything except executable code/functions. There is no standard that says what you can and can not put in heder files -- its just common sense. | |
Re: >>i need answer for my asingment,please So what don't you understand about the assignment? Hint: No one is going to write it for you unless you pay them lots of $$$. | |
Re: I have two cases of vintage Bud Light beer (2+ years old now) that I'd like to sell. | |
Re: line 5: float vector[]; arrays are declared with the star, like this: [icode]float* vector;[/icode] In the constructor you need to allocate memory for the array [icode]vector = new float[x];[/icode] Change the name [b]vector[/b] to something else because vector is the name of a c++ class declared in <vector> header file. | |
Re: The only way to physically delete a record from the file is to rewrite the entire file. If the file is small enough then just read the entire thing into memory, then write it back out to the same file but omitting the record to be deleted. Another method that … | |
Re: strncpy() is just like strcpy() but you can specify the maximum number of characters to be copied. But you have to be careful with that function because it will not null terminate the destination sting if the source string is longer than the number of characters you specfy in the … | |
Re: Maybe you are searching for the wrong thing. [URL="http://lmgtfy.com/?q=winsock+tutorials"]Try this one.[/URL] | |
Re: Yes, of course you can create java source files from c++. Once the java source code is created just run it though a java compiler. | |
Re: C and C++ languages do not perform garbage collection. That is left up to the programmer. | |
Re: In your example x is an integer while var is a character array. In that case x can not be a pointer to var without a typecast. [URL="http://daweidesigns.netfirms.com/cgi-bin/pointers.php"]Here[/URL] is a good explaination of pointers. | |
Re: >>while ('q' != getline(cin, str)) getline() doesn't return a character; it returns the [b]this[/b] pointer. | |
Re: Don't hold your breath waiting to find the answer for Turbo C. [URL="http://cboard.cprogramming.com/c-programming/110163-loading-displaying-images.html"]Here[/URL] is just one of may threads you can find about that topic. Doesn't look good for you. | |
Re: [URL="http://msdn.microsoft.com/en-ca/beginner/cc305129.aspx"]Here is one[/URL] | |
Re: line 16: variable phone is too small. strncpy() must have enough room for NULL terminator. Must be at least 6 characters, not 5. Since you are wriing a c++ program why don't you replace C character arrays with std::string? std::string is a lot easier to work with than character arrays, … |
The End.