49,761 Topics
| |
Hi , I am new to c++. I am reading "C++ How to Program" .In one example author divided the program into 3 files. The first one is Gradebook.h which contains prototypes. second Gradebook.cpp which contains actual implementations of member functions of Gradebook.h. last file is fig03-14.cpp which contains objects … | |
I've searched Google and have not found a solution to my problem. Function is to take a parameter and do a calculation on it. Based on the initial conditions it is supposed to return true and the the value calculated via a reference parameter. Basic code before all modification to … | |
Hello All, Can I use cin.getline(x,y) to read a line from a file? What is the form of cin.getline(x,y) when used with files? What I need to do is to output what I have written to a file to the console. I have the file open, using ofstream, and I … | |
Hey. Right now in my game (online) I'm using std::vectors to store player info. Should I continue to use them (I hate having to loop thru them each time to find a player) or should I use MySQL to hold player information (like map their on, nickname, id, position, etc.)? | |
Hi guys, I'm working on this problem I've been struggling with for a while now. I'm still confused about parameters and I'm getting all these error messages, saying that a lot of my variables are undefined. I'm sorry, I know this probably looks like a mess right now, but if … | |
Here is my code, the aim is to use dynamic memory and pointers. The program siccesfuly reads in data from a text file into the dynamic array(matrix). The size of the array is also in the text file, so thats how the size of the array is known. I am … | |
Hi everyone. I need help with an assignment that calls for a puzzle. The puzzle has five levers, numbered 1 to 5. All the levers must be down to complete the puzzle. The program produces a random puzzle each time it is opened or a new game is played. It … | |
Hi, I am trying to update a MS access table from my combobox selected item. Here is what I wrote: [code] String^sqlQuery= "UPDATE Profiles SET "+"Wallpaper='"+ comboBox1->SelectedItem->ToString()+"',Ringtone='"+comboBox2->SelectedItem->ToString()+"'"+"WHERE Profile_Name=MotoX"; this->oleDbDataAdapter1->SelectCommand->CommandText=sqlQuery; this->oleDbConnection1->Open(); this->oleDbDataAdapter1->UpdateCommand->Connection=oleDbConnection1; this->oleDbDataAdapter1->UpdateCommand->ExecuteNonQuery(); this->oleDbConnection1->Close(); [/code] However, I keep getting error of "Parameter ?_1 has no default value" I searched through many … | |
I keep getting D3DERR_INVALIDCALL from my CreateDevice() call. Here it is: [CODE]long dev_result = d3d->CreateDevice(D3DADAPTER_DEFAULT,D3DDEVTYPE_HAL,m_window,D3DCREATE_MIXED_VERTEXPROCESSING, &d3dpp,&m_device);[/CODE] I think the problem is with m_window. Here's its creation: [CODE]if((m_window = CreateWindow("WindowClass",m_setup->name,g_deviceEnumeration->IsWindowed() ? WS_OVERLAPPED : WS_POPUP,0,0,800,600,NULL,NULL,m_setup->instance,NULL)) == NULL) { MessageBox(NULL,"Error creating the window","CreateWindow()",MB_OK | MB_ICONERROR); return; }[/CODE] It's really weird. I put breakpoints … | |
Hello, I am a PHP programmer, trying to transition to C++. I need C++ to communicate with MySQL, so I realize i need to have mysql++ libraries. I am using winXP. I have MinGW. I am just trying to install MySQL++, and I am having problems. I have been following … | |
Can anyone tell me what is this, to me it look like struct in a struct, if I were to write the OOP program to sort an array 5 of these object variables, where would I start?? What will be the out put should look like?? Can someone give an … | |
I'm having trouble adding ("books") nodes to a tree. I have a class (BookRecord) that has a pointer to BookRecord *left and BookRecord *right, they are private but each have a get and set function..get/set left/right() I am trying to accomplish: - Add a single node that is passed in … | |
Hi I have a homework assignment that ask you to complete an empty project that contains a queue and stack. the data should be stored in a circular array. Functions of the queue are: pushBack : to insert in the back pushFront : to insert in the front popBack : … | |
Does anyone know how to get winsock2.h functions to work in a thread created by CreateThread(....)? All my code works outside a thread, but when I put it in the thread, it cannot bind the socket and read from etc. Thanks. | |
I am currently using Kubuntu 8.04. Although I do not know any bash, I altered the bash shell (via internet guides) to append history instead of truncating the history file. After editing the shell, the default way to clear the history only clears the interactive history and not the actual … | |
Sorry guys i know this might have been posted before but i was wondering if maybe you lot could help me out. I have done alot of searching and haven't seem to come across anything relevant or helpful. I need to create a GUI for a simple registration process for … | |
Hi, I am getting an error C:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\include\cstdio(17) : error C2143: syntax error : missing '{' before ':' C:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\include\cstdio(17) : error C2059: syntax error : ':' I've declared a namespace in my header file. In that i have some string manipulation … | |
I have to write a programme `r=1/x+2/x^2+3/x^3+....n/x^n` i write the program but cant get the answer can someone correct me faster plzz //#include <iostream> //using namespace std; //int main() //{ //int n=0,i=0,j=0; //double x=0,r=0; //double numerator,denominator; //cout<<"Please enter a value for n:"; //cin>>n; //cout<<"Please enter a value for x:"; //cin>>x; … | |
Helo, i want to write open SSL based c,c++ application for client socket in vc++ without using any API of winsock or MFC functionality. can u guide me how do i implement it. I search a lot on google but not getting exactly. Regards, Amit | |
Hello I get 'segmentation fault' at seemingly random places when reading from a file = running getline(*stream, stringLine). Running Rational Puify I get the info: Invalid Pointer Read: Reading 655816 bytes from 0xfefa846c between the heap and the stack (342896 bytes at 0xfefac490 illegal). I guess that the stream pointer … | |
Greetings, I have a problem. I have an abstract class called Number and 3 derived classes called Integer,Double and Float. The Number class has an abstract virtual method, which the derived classes (obviously) must inherit. Now comes the part where im stuck. The method has to be declared using a … | |
Hi I was wondering if you can help me write a code that i can use for keeping track of my grades. It will return my overall class average to the main () for output. Also it will pass my average to another funtion that uses the average and returns … | |
This is what I need > 1) I also need to use a for loop to prompt user to input two intergers: firstNumber and secondNumber (firstNumber must be less then secondNumber) > 2) Outputs all odd numbers between firstNumber and secondNumber > 3) output the sum of all even numbers … | |
Hi I'm new to programing. My tearcher gave me a ster program where there are 4 right triangles, that triangles 2-4 are just reflections/rotations of the first one - all being right triangles of size 10 on the perpendicular sides * ** *** **** ***** ****** ******* ******** ********* ********** … | |
Hi.... I want to create program to show that [COLOR="Red"]bios password is set or not[/COLOR] means Bios password is Enable or Not... [COLOR="Red"]How to check this setting through c or c++ programing[/COLOR]........not by manual setting Is it any registry or log or inf file that shows Bios password is enable … | |
hi, whenever std::string is assigned to another std::string its giving me a memory leak,why is it so....generally std::string's destructor takes care of freeing it.......can anybody help me wht to do to avoid this type of memory leak...??? | |
i want to write an object oriented program using classes and sequential files there is a store which keeps record of its customers' info in a file: customer code char6 customer name char30 total cost of products bought so far long int owe long int date of last purchase char8 … | |
hi, this code compiled using visual studio. Have changed the line const size_t i= __gnu_cxx::hash(x); from const size_t i=stdext::hash_value(x); so that it would compile using gcc. However I am getting an error message as shown below. Any suggestions appreciated. Thx [code=cplusplus] template<class X, class Pred= less<X> > class Hash{ private: … | |
How to [COLOR="Red"]check USB is enable or not [/COLOR]in c++ programing. Plz give me some hints or sample code or links | |
Hi Guys, Can someone please explain me why this is happening [code=cplusplus] #include<iostream> using namespace std; class a { public: int a1; // If I remove this it'll work fine a() { cout << "Constructor of a \n"; } ~a() { cout << "Destructor of a \n"; } }; class … |
The End.