- Strength to Increase Rep
- +9
- Strength to Decrease Rep
- -2
- Upvotes Received
- 30
- Posts with Upvotes
- 28
- Upvoting Members
- 24
- Downvotes Received
- 2
- Posts with Downvotes
- 2
- Downvoting Members
- 2
Re: You put a backslash in front of the special character (the double-quote or the other backslash) in order to remove its specialness and simply display it as is. Try this: [icode]cout << "\"\\n\"" << '\n';[/icode] | |
Re: You do not have enough disk space to save the pre-compiled headers (PCH file). Delete some files and try again. It is beside the point that your other files compiled nicely. This problem has nothing to do with your code. | |
Re: Or do it in one step: [code] For each char in str: If it's a space: * Remember that you saw a space, but don't copy it to the output string. Else (if it's not a space): * If it's not leading space: * Copy a space to the output … | |
Re: Narue: "Posers should know their limits." You say it's rude to resurrect old threads but you're rude whenever you feel like it. One of the rules of this forum is "keep it pleasant". You are not following that rule. It's sad how a relatively simple skill like programming can go … | |
Re: You only need to loop through less-than-half of the matrix since in each execution of the inner loop you're swapping two elements (and the main diagonal stays put). If you iterated through the whole matrix, you'd just put it back the way it started. Starting j at i+1 loops through … | |
Re: wherex, wherey, gotoxy are all Borland extensions. (Do Borland compilers still support them?) You can learn how to do it using the OS functions directly yourself. | |
Re: [QUOTE=moshe12007;807837]I read 3 c++ books on dos[/QUOTE] Now that you're a DOS expert, the world is your oyster! | |
Re: They are all "floating point" types. "double" is basically short for "double float" (but you can't say that). A float is usually 32 bits long whereas a double is 64 bits. A long double can be anywhere from 64 (same as double) to 128 bits. I hear "C++ from the … | |
Re: Programmers do not use "word wrap". Try hitting "Enter" once in a while. | |
Re: Here's one way to find the PID from the exe filename. [code] #include <windows.h> #include <tlhelp32.h> DWORD PID_from_EXE (char *exe_name) { DWORD ret = 0; PROCESSENTRY32 pe32 = {sizeof (PROCESSENTRY32)}; HANDLE hProcSnap = CreateToolhelp32Snapshot (TH32CS_SNAPPROCESS, 0); if (hProcSnap == INVALID_HANDLE_VALUE) return 0; if (Process32First (hProcSnap, &pe32)) do if (!strcmp (pe32.szExeFile, … | |
Re: There would seem to be method in such madness. But, as Narue said, you cannot entirely solve the tree without an inorder traversal as well. The problem should be solved recursively, as you might expect. [code] pre: C B A E D F H post: A B D H F … | |
Re: Do you just mean something like this? [code] test: [i]dependencies[/i] gcc prog1.c -o prog1 gcc prog2.c -o prog2 [/code] | |
Re: Someone might actually look at your code if you post it as a single zip file. Edit your previous post if possible. | |
Re: The code looks reasonable, except that "and"ing with 0x0fff and 0xffff does nothing in this situation (assuming 16-bit shorts). Removing those will change nothing, however. I would check the "answer" you've been given before going any further. Your code may be just fine. As for test_crc, there is no reason … | |
Re: Can you install a newer version of the TurboC compiler? Or can you switch to a better IDE/compiler like MSVC++ or Codeblocks? | |
Re: When Knuth talks about random numbers he mentions a CD of random numbers called "Black and White Noise" which is a mixture of deterministically sampled rap music combined with white noise. | |
Re: sid> Just check what would happened if delete would reset the pointer to zero: Nothing would happen! Are you a mindless idiot? Did your brain fall out? Did you replace it with a turd you found on the ground? delete does nothing if it's passed a zero pointer! Moron! I … | |
Re: The whole point of prefix notation is to represent the formula in such a way as to eliminate the complications of precedence and association. To reinstate these complications is sidiotic. I feel the most likely case here is that you are misunderstanding the assignment. It makes perfect sense to process … | |
Re: I don't understand the question. Perhaps if you describe what you are trying to do. In general, people seem to be overusing strtok. Often it's not the way to go. Your's looks like a job for sscanf or fscanf, but it is hard to tell without more info. | |
Re: main must return int (not void). You are missing a closing brace. "five" is a strange name. datum is spelled with a u. See comments in program. [code] #include <iostream> #include <fstream> #include <vector> using namespace std; struct five { float column1, column2; }; // Does not need to be … | |
Re: ThreadTime does not have access to hWndDlg. You need to either make it global (DlgProc would set the global var in WM_INITDIALOG)or pass it as a parameter to ThreadTime. | |
Re: This: [icode]void FindcarVin(int , string , string, int , int );[/icode] is not the same as this: [icode]void FindcarVin ( int vinnums[], string brandnames[], string modelnames[], int yearnums[], int specnum )[/icode] See the difference? It's always best to copy the definition's signature, both to ensure the prototype is the same … | |
Re: Instead of a bunch of parallel arrays like this: [code] int vin[SIZE]; string brand[SIZE]; string model[SIZE]; int year[SIZE]; int mileage[SIZE]; double mpg[SIZE]; [/code] try a single array of structs like this: [code] struct Car { int vin; string brand; //etc. }; Car car[SIZE]; [/code] And all your function signatures become: … | |
Re: > the lack of any apparent connection makes me think i'm initiating > something else (one of the libraries or something from the OS) > that has a run-time error Although possible, you should consider this as a last resort. Otherwise it will dull your mind to the more likely … | |
Re: Minimally you must handle single quotes, double quotes, single-line comments, and multi-line comments, since, as ArkM has pointed out, these constructs may contain parens (etc.) which you will want to ignore. | |
Re: The best solution is always the simplest one that does the trick. So, since you're only instantiating it with one type (i.e., a Comparable and it's derivatives), you don't need a template. That's what JohnA was saying. [code] class Comparable { public: virtual int compare( const Comparable& c ) const … | |
Re: So you're saying that if you take the exact same exe and config file that works on your machine and transfer it to your friend's machine, it doesn't work? Does he have the exact same OS as you? Has he installed your program in the same way as you have? | |
Re: Such flat, lifeless code. Why? No code tags! ;) You're reading over and over to the same part of the buffer (and zeroing it before every read). Move the zeroing (if necessary) outside the loop, and either move along the buffer (read into buffer+size) or do the file operations on … | |
Re: You need to declare your object array like this: [code] typedef struct Object3D { int** facets; float** vertices; int nFacets; int nVertices; } Object3D; Object3D *object; // Object array int numObjects; // Number of objects in object array [/code] And the object array is accessed like this: [icode]object[nObj].nFacets[/icode] At this … |