49,757 Topics
| |
Good afternoon, I have been working on a simple problem for a long time because I am really not sure how to approach it. I need a user to type in a sentence at a command prompt, after that I trim the String and place it into an array to … | |
I am writing a Windows API program. I noticed that WM_KEYDOWN message is not sent to the window procedure when I press Alt + Backspace. what message is sent when I press Alt + Backspace? | |
Hey guys, i am having a problem in my query statement. I am using Mysql in Netbeans and c++. Really Hope for some help. I posted it here as i read up a bit on it and it seems the solution is based on c++. What i am trying to … | |
i keep getting 4 errors on here and i cant figure out what they are I followed the syntax i believe [CODE] } if (( tot_mon <= 0.0f && orig_mon <= 0.0f)) cout << "You need more cash, you dont have enough\n" << endl; else if (tot_mon <= 0); cout … | |
I have a program for school. The program is an inventory program. It will start by writing blank records to a file. The user then should have a case drive menu. The user will select an option for what action they desire. Actions are add new record, change record, and … | |
i want to make an Object Test to control many threads. Test.cpp [code] class Test{ public: Test(); void exampleThread(void*); }; Test::Test(){ _beginthread(exampleThread, 0, 0); } void Test::exampleThread(void* ptr){ ... } [/code] i get the error [quote] argument of type `void (Test:: )(void*)' does not match `void (*) (void*)' [/quote] what … | |
ok how will i keep track of the items i bought? i have not the slightest clue on that. i dont even know where to start. can someone point me in the right direction? [CODE]#include<iostream> using namespace std; int main() { char symb; int item_purch, numb_item_purch, quit,; double mug = … | |
how do i create a new instance of a class at runtime? ok say i have a window open and every time i click inside the windows it puts a small image ( which is defined in the class ) at the location of the mouse pointer. But how can … | |
Is there anyone out there that finds Visual C++ (ver8) Debugger broken? Specifically with regard to variables out of scope. I have asked here about specific problems and none of the proposed solutions work. The debugger works on the easiest of things, but half the time, things that are obviously … | |
Hi there I want to use c++ to draw a path The path is based on two variables, x and y and x and y will change automatically every second So I think the flow should be like this: t=0, (x,y)=(0,0) ->draw a point on the graph t=1, (x,y)=(2,2)->draw another … | |
Dear all, Forgive me for posting two threads for the same problem. I was not showing my problem clearly enough in the previous one. Thank Narue for answering that anyway. Now I do it again here: [CODE] #include <iostream> #include <string> using namespace std; int main(void) { string inputStr; while … | |
Hi There, I need assistance with the assert function. The question is convert a date to Julian date and then check which one is the smallest and subtract to show the different days. That is all done. The part I have no idea is how to use the assert function … | |
I am very new to C++ and would like to know how to handle the following: Let's say I have a button on a form. When the user clicks the button, a new textbox is created on the form. How can I add event handling for this new text box? … | |
Hi and I have a hex to int function but it isn't converting the hex to integers properly. Below is the code an example is the hex bb76e739 which should = 3145131833 but with the function it equals 2147483647. I heard sprintf or something like that can convert the hex … | |
In my assignment I am supposed to use a pointer to create a 2-D array dynamically. Initialize each element in the array to the sum of its row and column. Then display each element of the array on the console. I have the program written and it works except for … | |
Tried this on my UNIX box.. Why aren't the array contents being stored/displayed ?? [CODE]#include <iostream> #include <fstream> #include <unistd.h> #include <sys/signal.h> using namespace std; int main(int argc, char *argv[]) { int pid; pid_t pid_chk; int pid_array[2]; int count[25], length, i, j; for (i=0; i<3; i++) { pid_array[i] = 0; … | |
int main() { recurse(5,3); return 0; } // end main void recurse(int x, int y) { if (y > 0) { ++x; --y; cout << x << " " << y << endl; recurse(x, y); cout << x << " " << y << endl; } // end if } … | |
I am making a pong-like game for a class. I am having trouble with the ball's collision detection. The game is a 1 player version, where the ball and paddle are both contained in a box. The player uses a gun which is built into the paddle, in order to … | |
I use a panel and if the user Leftclicks an area with the mouse, I am trying to set the variable LeftRightClick to "Left" and the same for rightclick, "Right". Then I call the button43_MouseDown event to show the correct MessageBox, depending on if it was a leftClick or RightClick. … | |
Hi All, Can anybody help me to assign a base class function pointer in derived class constructor? I have got a compilation error while doing so. Please see the code below: [CODE]class Base { public: void (* fnptr) (void) ; void myvurtualfn() { } }; class Derived:public Base { public: … | |
[code] int main() { string s = "12a34b56c78d"; int size = 12; writeStuff(s,size); return 0; } // end main void writeStuff(string s, int size) { if (size > 0) { cout << s.substr(size-1, 1); writeStuff(s, size-3); } // end if } // end writeStuff[/code] What is supposed to be the … | |
#include <iostream> using namespace std; int num, factorial; num = 6; factorial = Fact(num); cout << num << "! = " << factorial; return 0; } // end main int Fact (int num) { if (num == 0) return 1; else return num*Fact(num-1); } //end Fact int main() What is … | |
i need help creating a rectangle where the user creates the border and fills in the empty space with any symbol they want. it should look like this ####### #@@@@# #@@@@# #@@@@# ####### mine only looks like this # @@@@@ # @@@@@ # @@@@@ any help??? heres my code: char … | |
New to templates and lists but i have to use them for a class project. I got it working in one file then i tried to make it a class and I keep getting this error: 1>c:\users\r4ck13y\programming\c++ projects\project2.1\project2.1\merginglists.h(11) : error C2955: 'std::list' : use of class template requires template argument … | |
Hi, I'm having a problem with displaying names from a text file. I'm passing the names from the text file to an array that will be sorted, but I'm not getting the names to show like I want them to. It should display the different names as Last, First But … | |
How would i keep track of money spent? and items bought when i loop and how do i say i want multiple items meaning if i want to purchase more than one teeshirt or mug. /* SIUE's bookstore is having aspecail sale on tiems embossed with the cougar logo. For … | |
Can someone quickly point out what the problem is here? I'm sure it's something small but I've been coding for too long to see it. The problem is that in the balance method call, the first parameter is an array. if I hard code a test array, or if I … | |
I have a panel called panel1. What I wonder how it is possible to do is that when you click the mouse on the [B]location 304,369[/B] in the panel, I want to display a messageBox. How would that be possible to identify the location in code ? [code] private: System::Void … | |
Hello, I am working on a program that takes an integer array filled from a random number generator. These values are suppose to be from -5000 to 5000, 2500 of them. Then I want to find the standard deviation of the numbers in the array. I am required to use … | |
I've been trying to fix this error for a while now, I could really use some help. C:\Users\Clayton\Documents\CH4P11.CPP(71) : error C2676: binary '>>' : 'class std::basic_ostream<char,struct std::char_traits<char> >' does not define this operator or a conversion to a type acceptable to the predefined operator code: #include <iostream> #include <iomanip> using … |
The End.