48,986 Topics

Member Avatar for
Member Avatar for WongTinMing
Member Avatar for Salem
0
93
Member Avatar for nizbit

I am having a little bit of a dilemma. I have an input file that can have a number 1 through 9 or a asterisk. I am treating 1-9 as a character. I don't know if there is white space or new lines. I can't use >> because I don't …

Member Avatar for VernonDozier
0
109
Member Avatar for EnjozLearniz..

Hi mates I m new to C++ and I am trying to understand some code. ->Could one of u please explain me the three following lines of code: [code=c++] std::map<Pos3D,Object3D> Found3Dobjects; std::map<Pos3D,Object3D>::iterator Found3Dobjects_iter; typedef std::map<Pos3D,Object3D>::value_type Found3Dobjects_Pair; [/code] I read some tutorial for maps and got the idea. What I completely …

Member Avatar for jencas
1
84
Member Avatar for minwei86

Hello, This is my program here...I want to make it read from a textfile and displayed in this way Number : 1 Roman Numeral : I Number : 2 Roman Numeral : II My textfile is in this form: 1 2 but i still unable to solve it...is something to …

Member Avatar for mcriscolo
0
98
Member Avatar for Kamal_Java

Hi , I have a stl list which stores my base class pointer .Like [CODE]list<BaseClass*> eBList;[/CODE] now i want to iterate through this list and store it in one local variable. how do i do this. i have shown below the code i tried .... But at one part it …

Member Avatar for Aashath
0
155
Member Avatar for Dontais

I'm probably just confusing myself, but what the basic idea is I put in a grade and it outputs if the grade is an f, c, d ... etc. It allows me to enter a number and after I enter it it will continue to show F! repetitively. After this …

Member Avatar for Dontais
0
109
Member Avatar for koushal.vv

How to add keyboard shortcuts to Menu in an SDI application? Some of the things that i have tried is : say Context menu has a sub menu called Menu1 , i have mentioned it as &Menu1 which makes Ctrl + M as keyboard short cut for it [ but …

Member Avatar for jencas
0
158
Member Avatar for grisha83

Hello everyone I am trying to do this assignment in the book: Write a program that reads four words (as character strings) and display them in increasing and decreasing alphabetical sequence. I have done the 1st (easy) part but not sure how to go about displaying words in alphabetical order. …

Member Avatar for grisha83
0
133
Member Avatar for PaladinHammer

[CODE]#include <iostream> #include <fstream> #include <string> #include <iomanip> using namespace std; int main () { ifstream fin("program4.txt"); ofstream fout("output4.txt"); string lastName; string firstName; string fournumbers; if(fin.fail()) { cerr << "Unable to open input file\n"; exit(2); } if(fout.fail()) { cerr << "Unable to open output file\n"; exit(3); } while (fin >> …

Member Avatar for stilllearning
0
139
Member Avatar for Ellisande

To pass an ifstream type as an argument for a function? [code]bool initGame(Game &game, int argc, char *argv[]){ ifstream board(argv[1]); // <------------------- This part ifstream deck(argv[2]); int numPlayers= atoi(argv[3]); int numRounds= atoi(argv[4]); if (board.fail() || deck.fail() || numPlayers==0 || MAXPLAYERS < numPlayers || numRounds < 1 || numRounds > 1000 …

Member Avatar for Ellisande
0
187
Member Avatar for charusood

7. Given the class definition [code=cplusplus] class A { public: //constructors // other members private: int x; int y; }; [/code] Give declarations of operator functions for each of the following ways to overload operator+ you must state where the declaration goes, whether within the class in the public or …

Member Avatar for Ancient Dragon
0
86
Member Avatar for unk45

so ive created a function that replaces all user input characters in a string with another specific user input character..the next task is to create a func that replaces a particular part of the string with a substring and ive got something down but i cant really test it becuz …

Member Avatar for mcriscolo
0
90
Member Avatar for Jennifer84

How is it possible to get a menu where you rightclick on the Form ? I am not sure if this is the contextmenu. I tried to add this to the Form and also some components to it but that did however not work.

Member Avatar for Jennifer84
0
114
Member Avatar for Aamp88

hey everyone. i'm fairly new to programming and right now i'm taking a clss where i have no idea what is going on but anyway if someone can help me write a small simple code for a small simple program where i hav to use transducer i can paypal you. …

Member Avatar for William Hemsworth
0
137
Member Avatar for Niner710

If I have a bunch of structures defined within a class header file but outside the scope of the class how would I set a SETTER function to change the values. [code] struct VoltageValues { float Vcc; int TblkLoopEnb; double Blah; }; class TblkArray { public: TblkArray(); ~TblkArray(); struct VoltageValues …

Member Avatar for mcriscolo
0
154
Member Avatar for Niner710

Hi, I am new to C++ and trying to write a function that returns a pointer to a structure. I have a header file as follows. [code=cplusplus] class Blah { public: struct Values *getValues(); struct Values { int A; int B double C; } } My class file is as …

Member Avatar for ArkM
0
126
Member Avatar for joed13k1941

I wrote the following program with the instructions in the top comments: ( I am using visual studio on vista) [code=cplusplus] #include <iostream> using namespace std; int main() { int num1, num2; int total = 0; cout << "Please enter an integer between 0 and 100: "; cin >> num1; …

Member Avatar for joed13k1941
0
228
Member Avatar for onemanclapping

Hi, I'm doing a program that has a class called Liga. That class has a vector with 'Equipa's. Liga has a vector called 'pessoas' which I want to access inside a function in each Equipa, is this possible? for example: Liga.h [CODE]... vector<Pessoa*> pessoas; ...[/CODE] Equipa.cpp [CODE]... void Equipa::mostraStaff() { …

Member Avatar for onemanclapping
0
113
Member Avatar for scotchfx

If in a class method I pass in a list: std::list< regmatch_t* >& pm_list; and dynamically allocate memory for an array (of type regmatch_t) which is then added to the list as a pointer: regmatch_t* pm = new regmatch_t[ num_subexpressions ]; pm_list.push_back( pm ); will the list destructor automatically deallocate …

Member Avatar for Narue
0
127
Member Avatar for manzoor
Member Avatar for e_agam
0
75
Member Avatar for transplantedNYr

I have to take the following code and make it tail recursive. I am not looking for the answer, but how to find the answer. How to work through this to understand what I need to do. Our hint is that we can change the parmeters of the function, like …

Member Avatar for transplantedNYr
0
93
Member Avatar for DemonGal711

FIXED - I'm getting a parse error somewhere in this section of code before the else and I can't see it. Please help someone. [B]NEED HELP HERE -[/B] Okay, I'm apparently getting a parse error somewhere in this code. Any help? All the errors are listed as "Parse error before …

Member Avatar for stilllearning
0
543
Member Avatar for Th3_uN1Qu3

Hey, it's me again. This time with a thing that has been bugging me for months and i still haven't gotten around to solving it. I need to install a font without rebooting the computer. Sounds simple but i have to do it in code or with a batch file, …

Member Avatar for Th3_uN1Qu3
0
841
Member Avatar for unbeatable0

Is there a way to #define something as a #warning? I tried using the following code, but it gives me an error: 'warning' undeclared (first use this function) This is the part of code where the error appears: [code=c++] #define something #warning This is not a standard function! int main(void) …

Member Avatar for Salem
0
210
Member Avatar for acoxia

Hello i have a project to write a program that takes 2 binomials from a text file then factor them and output it into another text file. I'm curious on how to begin going about this do i take the 2 binomials such as (x+5)(x+9) and put them in a …

Member Avatar for acoxia
0
147
Member Avatar for saneeha

I am using getfilepathname() to get the path of a particular file. but it returns the path of the project. i am using findfirstfile() and findnextfile() to get the handles, but still it doesnot show the directory in which handle is present... can any one help me on this issue …

Member Avatar for Salem
0
102
Member Avatar for NinjaLink

I have the whole code written for what I want to do, but the only problem is, on my Daily_Average function, I want to print the average of the scores occurring Day 3, but I'm getting average of ALL scores together as one. Here is an example of the scores …

Member Avatar for NinjaLink
0
105
Member Avatar for pads

this is my program i am getting a error while compiling it can someone help me... error is ----- Build started: Project: paddy, Configuration: Debug Win32 ------ Compiling... manager.cpp c:\documents and settings\others\my documents\visual studio 2005\projects\paddy\paddy\manager.cpp(51) : error C2664: 'Pensioner::Pensioner(char *,char *,char *,long,char *)' : cannot convert parameter 1 from 'std::string' …

Member Avatar for ArkM
0
2K
Member Avatar for saneeha

I need to extract complete path for a file givne the file name. I am using the function GetFullPathName() but it only appends the current directory of the project with the file name.. Is there any modification or some other function which can help? I am using visual studio 2005 …

Member Avatar for ArkM
0
244
Member Avatar for c++ prog

hi, my problem is about socket programming. My code below only connects the client to the server, and it works just fine. However, I should create a 2player game which of course require the interaction of the 1st and 2nd player. The problem here is that they really don't interact …

Member Avatar for c++ prog
0
125

The End.