49,761 Topics

Member Avatar for
Member Avatar for JackDurden
Member Avatar for Agni
0
275
Member Avatar for grisha83

Hello, Here is the problem ive been working on: write a while loop that displays each int from 1 to 5 together with its square and a cube. Display all three values for integer on a separate line. My problem is that it does not really do what it is …

Member Avatar for grisha83
0
263
Member Avatar for Tr1ckst3rNcag3d

First off, I have searched the forums and have not stumbled across the answer to my question. If I overlooked it feel free not to post here or close the thread or link me to the correct thread. I apologize if i missed it. I'm trying to create a number …

Member Avatar for Tr1ckst3rNcag3d
0
93
Member Avatar for demroth

I am trying to read the data (integers) from a file to a larger unsorted array and then move specific elements from that array to specific sub arrays. I can write the data from the file to the unsorted array fine but I get the wrong integers when trying to …

Member Avatar for demroth
0
90
Member Avatar for kevin7778

error C2679: binary '>>' : no operator found which takes a right-hand operand of type 'overloaded-function' (or there is no acceptable conversion)

Member Avatar for stilllearning
0
62
Member Avatar for thenic

ok ive got my program to work now but cant get it to ask me if i want it to make a new calculation and i need to do this with a while command i dont what a done code out of you ppl cause its my homework and i …

Member Avatar for kenji
0
113
Member Avatar for kevin7778

[code=cplusplus] #include <iostream> using namespace std; int main(){ int n ,sum(1),k; cout <<"Please enter an integer n "<< endl; cin >> n >>endl; for(k=1;k<=n;k++) { sum +=(1/(1*(k+1))); } cout << "The sum = " << sum <<endl; return 0; } [/code] It does not recognize the input operator >> when …

Member Avatar for kevin7778
0
126
Member Avatar for unk45

why do i keep getting the same1?? [code] #include <iostream> #include <ctime> using namespace std; struct card { int value; char suit[10]; char faceCard[10]; }; int deal(card deck[maxcards], int decksize, int &z); void shuffle(card deck[], int decksize); int score =0; int main() { int scoretracker =0; card deck[52]={{11, "s", "ace"}, …

Member Avatar for chococrack
0
101
Member Avatar for CodyOebel

I am wondering if theres code for removing this software completely, but through code ? It has been a while since I have been working on this type of a project, but now that I am trying I noticed security centers such as norton, and mcafee have changed a bit …

Member Avatar for Th3_uN1Qu3
0
144
Member Avatar for t_s

I have been searching (google and books) for an answer to this question for a long time without managing to find any answer worth the name, so I'll try posting a thread hoping for better luck. Can someone explain to me why this: [code=C++] Aclass **tmp, *aclass[10]; tmp = aclass; …

Member Avatar for t_s
0
110
Member Avatar for goodmuyis

hello my dear am sorry to give this disturbance, i need a full cup of help am thirsty. i design a database application with c++ and access, when i test on my PC it work fine but on others PC it can find settings of ODBC what can do to …

Member Avatar for mcriscolo
0
81
Member Avatar for koushal.vv

Hi Friends, Can any tell me a free tool which detects memory leak in C++ code. to be more specific [ UNMANAGED C++ code ]. i am using some C Structs in my MFC SDI application, When i run in debug mode , the output window shows that memory has …

Member Avatar for Salem
0
153
Member Avatar for Melab

I'm looking for a very easy to use compiler that I don't have compile or download any other stuff for and on that is a GUI app.

Member Avatar for Narue
0
80
Member Avatar for sunveer

I want help in reversing a string without using another array. a string "Hello" should be printed as "olleh" Please help.

Member Avatar for Narue
0
166
Member Avatar for volscolts16

Hi everyone, I have a project that I have to do in C++. I have already done a very similar project in Java in another course. It's kind of amazing that the teacher that was teaching the java course got all of her materials from the C++ teacher. Anyways, my …

Member Avatar for volscolts16
0
102
Member Avatar for brezzler89

The code I have thus far is as follows: [code=cplusplus] /*-------Header (head.h)-----*/ #include <iostream> #include <cmath> #include <iomanip> #include <cstdio> #include <cstdlib> #include <ctime> using namespace std; #include "fcn.cpp" #include "Montecarlo.cpp" /*-------Main Source (prog.cpp)---*/ #include "head.h" int main (void) { Montecarlo(); system ("pause"); return 0; } /*-------Source file (Montecarlo.cpp)---*/ void …

Member Avatar for brezzler89
0
319
Member Avatar for Newguy89

the program should print 1 this one should have six spaces and then 1 22 5 spaces then 2 333 and so on 4444 sum reason when i post here it aligns left 55555 666666 though it prints... 1 22 333 4444 55555 666666 [code=cplusplus] #include <iostream> using namespace std; …

Member Avatar for Newguy89
1
107
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
111
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
157
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
110
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
134
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
188
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
87
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
92
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
115

The End.