- Strength to Increase Rep
- +0
- Strength to Decrease Rep
- -0
- Upvotes Received
- 11
- Posts with Upvotes
- 9
- Upvoting Members
- 6
- Downvotes Received
- 3
- Posts with Downvotes
- 2
- Downvoting Members
- 3
34 Posted Topics
Re: This is a dependency error from **make**. buffer.o needs buffer.cpp but make cannot find buffer.cpp and therefor looks for a rule that can generate buffer.cpp (which fails). The dependencies must point to the actual files. buffer.o: /path/to/buffer.cpp /path/to/buffer.h g++ -c $< -o $@ You can also make a more generic … | |
Re: You can use the fseek function (in stdio.h) to set the file position (byte offset). | |
Re: A string object can store strings including whitespaces. I would guess that your problem is that you only read the first word the user inputs and ignores the rest. If you could provide the relevant parts of your code it would be much easier to help you, especially the part … | |
Re: According to the documentation (msdn) ShellExecute is in the Shell library in the Shellapi.h header file. Have a look at [URL="http://msdn.microsoft.com/en-us/library/bb762153%28v=vs.85%29.aspx"]msdn ShellExecute documentation[/URL] | |
Re: In Linux, the library for dynamic loading a library into the caller's address space is called dl, use the function dlopen to load and dlsym to resolve the function you are interested in calling. In Windows the function is called LoadLibrary and is a part of Kernel32.dll (defined in Windows.h). … | |
Re: Do you get the same problem if you debug the application? | |
Re: Please provide the exact error messages you get when compiling the code you have provided. | |
Re: Have a look at this [URL="http://www.daniweb.com/forums/post1476820.html#post1476820"]http://www.daniweb.com/forums/post1476820.html#post1476820[/URL] thread | |
Re: This particular algorithm depends on eliminating every multiple of each prime number (since that will not be a prime number), not the prime number them selves. When i = 2 arr[i] will be 3, and during the second time in the outer loop when j = 3 you will check … | |
Re: I assume that you want the following [CODE]while (isalpha(sheet[i].empID || !isdigit(sheet[i].empID)))[/CODE] to be [CODE]while (isalpha(sheet[i].empID) || !isdigit(sheet[i].empID))[/CODE] right? Another way of checking the input is to use formatted input with cin >>. You can enable exceptions by doing the following: [CODE] cin.exceptions(istream::failbit | istream::badbit); [/CODE] Then you can simply do … | |
Re: There is no need to for any static variables, use local variables instead by removing the static keyword. Also, maybe you should use a do-while loop when checking the input in getScore? What happens if the user inputs an incorrect value twice? There is no point in checking the argument … | |
Re: This depends on how your console/terminal interprets the character code. Every character is represented by a number. The mapping between number and character depends on which character encoding is being used. \u00A2 is a ascii representation of the unicode code point 0x00A2 representing the cent symbol. Since unicode requires one … | |
Re: I would like to know what this->tile is. Why 16? Without knowing this I would guess that there is something wrong with getTile. What compiler/debugger do you use? A backtrace would be very helpful. A backtrace would tell you which part of your code is causing the error. | |
Re: The easiest way to find out how objects are handled in different situations is to write a very simple program with a class that has traces in the constructor, destructor and the = operator. Another way is to use a debugger with breakpoints at the same locations. | |
Re: I think it is possible to send a WM_GETTEXT message to the child control (window) of another process (using SendMessage). You can use the spy++ application (included in visual studio, maybe?) to get information about the control you are interested in. Have a look at msdn under Library -> Windows … | |
Re: You can not copy strings with the assignment operator. Try using strcpy to set the title to "The Curious Case...". You can only use a constant string when initializing arrays. | |
Re: It is not very complicated. You have to remember the previous position and size of the ball. Before you update the screen you have to clear only that part of your viewport. In your case I would guess that you can paint a black rectangle at (x-10, y-10) with size … | |
Re: To do this you can use the following code: [CODE] #include <iostream> char* animals[12] = {"rat", "ox", "tiger", "rabbit", "dragon", "snake", "horse", "goat", "monkey", "rooster", "dog", "boar"}; int main() { int year = 0; std::cout << "Enter your birth year: "; std::cin >> year; std::cout << "Your animal is " … | |
Re: You cannot compare one value with two values at the same time. The < operator has left to right associativity. The if statement will always be true. If Total_minutes is 1 then 15 < Total_minutes will be 0 and 0 <= 30 is true. If Total_minutes is 90 then 15 … | |
Re: A new line is also a word separator (in most cases). You are also missing the last line since it will not end with a new-line character, you should count * as a line separator, or start with line set to 1. You should also initialize word to 0. | |
Re: The reason your code might work is because there are two levels of memory allocators in C++. The operating system does the actual allocation of the physical memory and maps it into the process memory space called heap (known page allocation). Normally this memory is not freed until the process … | |
Re: You should really read your error messages before posting, or post the error messages! 1. There is nothing called genereic_ptr 2. You have defined your stack structure twice You should not declare your functions as extern if you will provide your own definitions. How do you plan to use this? … | |
Re: Move numb = numb + 2 to the very end of your loop. I assume you want it to go from 20 to 60? | |
Re: First of all, n will be the same in all instances at a specific time since it is a static variable. n is increased when a CDummy object is created and n is decreased when an object is deallocated. You are creating 7 CDummy objects and therefore n is 7 … | |
Re: The assignment says "get the current speed of the car and display it". You do not! So.. you should display the speed of the car when you accelerate and brake. | |
Re: The first problem is that you do not specify AM or PM. You should let the user input AM or PM like this: [CODE] string ampm; cin >> hrOut >> ampm; if (ampm == "pm") hrOut += 12; [/CODE] Then you will have the time in 24 hour format (0-23). … | |
Re: Just to be clear, the problem is not that you have made your own constructor. The problem is that it takes one or more arguments. Why not simply add a constructor with no parameters, or add default arguments like this: [CODE] #include <iostream> class MyClass { public: MyClass(int val = … | |
Re: There are a couple of errors in your code: 1. The for loop in displayList should set current = current->next 2. getNewEntry should always set newOne->next to NULL! 3. buildList should not link newOne to itself!!! 1 and 2 is not difficult to fix. For nr 3 I would recommend … | |
Re: Sorry if you already know this, but it is not the class that stores the data unless the members are static. You can make m_sComPort and m_sBaudRate static and access them as DataClass::m_sComPort and DataClass::m_sBaudRate. Otherwise you must be able to access the object instance 'data' from form2. If you … | |
Re: I have never used allegro, but my guess is: - There is no function called install_timer_ex (maybe you mean install_int_ex?) - There is no function called textmode (seems redundant) | |
Re: What are you trying to do? To be able to __stop__ the loop, your while condition must change, which it never will. You must change the value of 'stop' inside your loop! Your loop will not even start until you press a key other than 's'. | |
Re: You should be able to compare *rankPtr to a character value, maybe not to an integer value depending on your compiler's error/warning settings. What is the error? It makes no sense to compare *rankPtr to both characters and integers.. Also, the loop looks strange, you are increasing the openPtr pointer … |
The End.