51,593 Topics

Member Avatar for
Member Avatar for Black Magic

Hey, I was using some code to write int's defined by user to a file but found when you use [CODE=C++]myfile.open ("lover_names.txt"); myfile << firstLover << " " << secondLover << " " << lovePercent << "%\n\n"; myfile.close();[/CODE] It replaces the other text in the text file, the answer will …

Member Avatar for Black Magic
0
84
Member Avatar for 3pid

Hi I`ve just started working with graphic in c++.I want to display a stack on the console . I taugth draw a rectangle as a stack.but the problem is I don know how to draw a rectangle! I write some codes but my compiler (Dev-c++) couldn support them. I found …

Member Avatar for William Hemsworth
0
236
Member Avatar for WeNeedThat

Its an assignment I have to submit, we have to make a maze using stack and input text file but I admit that i'm tottaly lost in this, something wrong with my code (or really alot of mistakes) please help! #include <iostream> #include <fstream> using namespace std; struct node { …

Member Avatar for WeNeedThat
0
100
Member Avatar for Nemoticchigga

Does anyone know if rs-232 c++ code written with the windows.h library is easily changed to support rs-485 and rs-422 or if its not similar at all? Thanks.

Member Avatar for Nemoticchigga
0
67
Member Avatar for bis student

Hi, could you explain how can I do the next ? A Member function named isVolumeBigger that takes as parameter a Box(Box class) object named another and returns bool value. The function compares the volume of the object with the volume of another and returns true if its volume is …

Member Avatar for Ancient Dragon
0
61
Member Avatar for ganiraju

Hi All, Radio Frequency Identification (RDFI) is a generic term for technologies that use radio waves automatically identify or locate people or objects. Incase you have any asset ideas or white papers on RFID technology please forward those to me. Thank you

Member Avatar for Ancient Dragon
0
140
Member Avatar for daviddoria

When trying to compile my code with g++ i get this: MayaFunctions.h:5:27: error: calling fdopen: Bad file descriptor in that line, I simply have #include "AnotherFile.h" Google told me this has something to do with precompiled headers, but I can't figure out how to turn them off. 1) how to …

Member Avatar for daviddoria
0
149
Member Avatar for hilofat

[CODE]#include <iostream> #include <fstream> #include <string> using namespace std; int main() { ifstream fin; string firstName; string lastName; int horseNumber; int betAmount; fin.open("jockey.txt"); if (!fin.good()) { cerr << "File not found\n"; return 1; } for (int i=0; i<10; i++) { fin >> firstName >> lastName >> horseNumber >> betAmount; cout …

Member Avatar for hilofat
0
74
Member Avatar for bamabambhole01

Hello, I am new in c++. Can somebody send me code for class ellipse. I am looking urgently for code. Regards,

Member Avatar for bamabambhole01
0
90
Member Avatar for recortebordes

Hi everyone! I have an interesting problem in borland c++. I have to write a DLL, which contains one function. The function's aim is to create a window with a progress bar, and a close button disabled. Then it downloads a microcontroller firmware via serial port to a device. After …

0
30
Member Avatar for jennyebrooke

Okay I'm gonna be honest with you... I have no idea what I'm doing... no not even a little. I'm in an online C++ class that I'm only taking because it was the last required course for me to graduate this semester... This is the last assignment due and I …

Member Avatar for littlestone
0
107
Member Avatar for Jennifer84

If I have a 2D vector like this that has 5000 elements declared. If I have filled 2500 of these elements with Numbers, what is the best way if I want to "emty" these elements so these elements will turn to 0 wich I beleive is the defaultvalue for all …

Member Avatar for vijayan121
0
248
Member Avatar for Indianblues

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 …

Member Avatar for Indianblues
0
178
Member Avatar for bustedsfnewkia

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 …

Member Avatar for littlestone
0
105
Member Avatar for Waseemn

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 …

Member Avatar for Salem
0
91
Member Avatar for hacker9801

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.)?

Member Avatar for Rajith Cherian
0
120
Member Avatar for shellsy

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 …

Member Avatar for shellsy
0
356
Member Avatar for Cosa

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 …

Member Avatar for Cosa
0
241
Member Avatar for wleemitch

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 …

Member Avatar for John A
0
107
Member Avatar for Adrian99420

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 …

Member Avatar for Adrian99420
0
81
Member Avatar for CoolGamer48

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 …

Member Avatar for CoolGamer48
0
295
Member Avatar for n00b3

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 …

0
65
Member Avatar for gazoo

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 …

0
65
Member Avatar for xm1014

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 …

Member Avatar for Lerner
0
73
Member Avatar for gehad3003

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

Member Avatar for gehad3003
0
184
Member Avatar for Nemoticchigga

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.

0
60
Member Avatar for c++noobie

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 …

Member Avatar for c++noobie
0
155
Member Avatar for gamblitis

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 …

Member Avatar for Ancient Dragon
0
83
Member Avatar for bodhankaryogesh

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 …

Member Avatar for Narue
0
103
Member Avatar for squint

Hello, On many forums I go by Squint. I am in Texas and taking a course in C programming. I am going through an online course and my instructor does not seem to have the time to help me out so here I am. I am attending Thomas Edison State …

Member Avatar for Serunson
0
75
Member Avatar for manojkumar2004

Hi all, instead of using the web service(soap calls).... I want to write some c# implementation of the wsdl file... any idea how to proceed ??

Member Avatar for tgreer
0
76
Member Avatar for sisi

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

Member Avatar for sisi
0
167
Member Avatar for Foobar69

Hello everyone! This is my first post here, so, hi. ;) So I'm beginning to port (actually, re-write) one of my C games to Python to extend my Python knowledge, using wxPython. Yes, I know of PyGame, but I really want to use wxPython this time. I'm guessing direct pixel …

Member Avatar for bumsfeld
0
63
Member Avatar for amit_pansuria

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

Member Avatar for amit_pansuria
0
2K
Member Avatar for LindaWiklund

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 …

Member Avatar for Salem
0
88
Member Avatar for flash121

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 …

Member Avatar for Narue
0
113
Member Avatar for chrisfrolich

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 …

Member Avatar for Narue
0
51
Member Avatar for timdog345

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 …

Member Avatar for Rajith Cherian
0
109
Member Avatar for computers08

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

Member Avatar for computers08
0
102
Member Avatar for Aamit

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 …

Member Avatar for Aamit
0
44
Member Avatar for risa

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

Member Avatar for mitrmkar
0
171
Member Avatar for scream2ice

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 …

0
77
Member Avatar for ktob

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

Member Avatar for ktob
0
499
Member Avatar for Aamit

How to [COLOR="Red"]check USB is enable or not [/COLOR]in c++ programing. Plz give me some hints or sample code or links

Member Avatar for Asat232
0
232
Member Avatar for humhaingaurav

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 …

Member Avatar for vijayan121
0
103
Member Avatar for Adrian99420

Hi, I created two window form (the two form call form1 and blank), when I click a button on the first form it will link to the second form. However, i face problem when I wish to change the second form text (name of the form) using the string I …

Member Avatar for mitrmkar
0
106
Member Avatar for scream2ice

i'm trying to write a program that reads a text from the user(keyboard) sentence by sentence and then prints the 'morse code' of them char bay char on a text file. I'm just testing it for the letter 'c' to start with, but it doesn't seem to be working well …

Member Avatar for John A
0
101
Member Avatar for amitpawar007

Hi All, I am using ACE. when i try to open a file with ACE_OS::fopen function in append mode, my program crashes. There seems to be no problem when i try ACE_OS::fopen function with write or read mode. code example. ACE_OS::fopen("demo.txt", ACE_TEXT("w")); // working fine ACE_OS::fopen("demo.txt", ACE_TEXT("r")); // working fine …

Member Avatar for Salem
0
173
Member Avatar for Indianblues

I am trying to learn c++ from past so many days.lots and lots of books are available.I am unable to find a good book which will teach me from basics to advanced concepts. please somebody suggest me good and complete book.

Member Avatar for Salem
0
65
Member Avatar for anbuninja

i dont understand looping at all. plese help if you can. i know its like doing my work for me but yeah i dont know looping. create a program that keeps reading a sentence and a character and displays how many times the character appears in the sentence until user …

Member Avatar for hacker9801
0
124

The End.