49,761 Topics

Member Avatar for
Member Avatar for WargRider

Dear Community, I know that Java and C# and various OTHER programming languages support a variable type Object, which is basically a variable that can hold ANY kind of variable type, from strings to booleans. I was wondering if this is possible in C++, I REALLY badly need something of …

Member Avatar for Narue
0
4K
Member Avatar for phohammer

I am attempting to create a GUI for a console C++ program in Visual C++. Apparently, it is like learning the language all over. Here is my problem: I am attempting to write the contents of a textbox to a file, but I get the error "error C2228: left of …

Member Avatar for phohammer
0
408
Member Avatar for mani_singh

hello all, i am new to c++ and just started learning about 1 week ago. i wrote a (console) program that does simple math, it asks you to enter couple numbers and will output an average. i want to know how to write and if statement where it will say …

Member Avatar for Dave Sinkula
0
83
Member Avatar for timbomo

[CODE]I cant get this to read these numbers correctly 11.95f, SQFT2 = 12.35f, SQFT3 = 13.28f, PI = 3.14159f, when i run it , the answer comes out to be a whole number 11.[/CODE] i also need help on the do while loop i almost got it but i ended …

Member Avatar for WaltP
0
83
Member Avatar for Jeronim

I'm writing some program and i was wondering is there any way to change ALL numbers in array at once for example when you initialise array you can write [CODE]int array[10]={0};[/CODE] is there anything like that i can use in the [B]middle[/B] of the program. I have googled for it …

Member Avatar for Narue
0
78
Member Avatar for JohnPhilipps

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 …

Member Avatar for JohnPhilipps
0
178
Member Avatar for CppBuilder2006

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?

Member Avatar for mitrmkar
0
78
Member Avatar for gregarion

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 …

Member Avatar for Fbody
0
2K
Member Avatar for timbomo

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 …

Member Avatar for Lerner
0
113
Member Avatar for jdpjtp910

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 …

Member Avatar for dusktreader
0
2K
Member Avatar for TheGhost

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 …

Member Avatar for nezachem
0
71
Member Avatar for timbomo

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 = …

Member Avatar for Lerner
0
166
Member Avatar for glenc70

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 …

Member Avatar for Narue
0
96
Member Avatar for walter clark

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 …

Member Avatar for walter clark
0
100
Member Avatar for yin1031

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 …

Member Avatar for yin1031
0
101
Member Avatar for jimFan

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 …

Member Avatar for Fbody
0
1K
Member Avatar for deetlej1

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 …

Member Avatar for deetlej1
0
158
Member Avatar for IDSTECH

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? …

Member Avatar for IDSTECH
0
85
Member Avatar for cwarn23

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 …

Member Avatar for mrnutty
0
183
Member Avatar for scott6480

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 …

Member Avatar for vmanes
0
144
Member Avatar for halluc1nati0n

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; …

Member Avatar for vmanes
0
149
Member Avatar for heredia21

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 } …

Member Avatar for Salem
0
105
Member Avatar for nola_Coder

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 …

Member Avatar for nola_Coder
0
91
Member Avatar for Lukezzz

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. …

Member Avatar for jonsca
0
174
Member Avatar for jesoj

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: …

Member Avatar for jesoj
0
1K
Member Avatar for heredia21

[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 …

Member Avatar for Ancient Dragon
-1
70
Member Avatar for heredia21

#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 …

Member Avatar for heredia21
0
67
Member Avatar for corby

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 …

Member Avatar for corby
0
178
Member Avatar for mrackley86

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 …

Member Avatar for mrnutty
0
178
Member Avatar for db132074

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 …

Member Avatar for NathanOliver
0
917

The End.