49,755 Topics

Member Avatar for
Member Avatar for winry

Hi, I've just started to learn vectors and wonder if there is a way to copy a vector that i use in main to a vector in a class??

Member Avatar for winry
0
80
Member Avatar for joed13k1941

Hey. Thanks for all of the help with my other questions. This forum has been very helpful. In this program, there is a note: "chocolate" may refer to either the ice cream or the sauce; assume it refers to the ice cream if an ice cream flavor has not yet …

Member Avatar for star4ker
0
433
Member Avatar for fox64

I've been wracking my brain over the last week. I have project due soon, but I'm having a lot of trouble with certain aspects of pointers in class instances. My project is to re-design the String class library by remaking basic functions. I was given a header file and told …

Member Avatar for fox64
1
92
Member Avatar for pdwivedi

i used following command to overcome edit-compile-run cycle while working with vim editor. :set makeprg=g++\ % then i ran the :make command every thing worked fine except that instead of jumping to the first error line in my file the vim editor shows that "[COLOR="Red"]type command or press enter to …

Member Avatar for pdwivedi
0
116
Member Avatar for seebharath

when creating a new xml file using xercesC++ all the attributes are ordered alphabetically at the output, how to see to it that the attributes are written in the order they are appended?? also how to associate with an xsd when creating a new xml with xerces C++

Member Avatar for Ancient Dragon
0
48
Member Avatar for Raschoc

I have been trying to compile my program but i get these error messages that i can't understand. Please help. these are the error messages I am getting error: could not convert 'MARITALSTATUS' to 'double&' error: in passing argument 2 of 'double FEDTAX(double, double&, int, int&)' err: In function 'double …

Member Avatar for Raschoc
0
119
Member Avatar for Mossiah

[CODE] #include "stdafx.h" #include <iostream> #include <iomanip> #include <string> using namespace std; char your_string[256]; char new_string[256]; void ReverseString(); int main() { char choice; do { cout <<"Enter the string that you want to reverse: \n"; cin.getline(your_string, 256); ReverseString(); cout << new_string << "\n"; cout <<"Do you want to continue? Press …

Member Avatar for Narue
0
71
Member Avatar for Lenny19

Hi, I have to display the details inside an array as a bar chart, the user has input the temperatures for the twelve months, here is the declaration and the user input: [CODE] int temp[12]; int menuChoice; char month[12][5]={"Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"};[/CODE] …

Member Avatar for Narue
0
109
Member Avatar for maru2

I am new to C++ and would like to know what style I should use to write my codes. For example, should I use: [CODE=c++] for (int i=0; i < 10; ++i) { cout << i << endl; } [/CODE] or [CODE=c++] for (int i=0; i < 10; i++) { …

Member Avatar for Narue
0
115
Member Avatar for cppStudent

I can't understand why there's a memory leak. Can someone please enlighten me ? [CODE=cpp]#include <fstream> #include <string> #include <iostream> #include <sstream> #include <stdlib.h> #include <math.h> using namespace std; class ChocBar{ public: ChocBar(string name = "Barone",double price =1.20){ name_ = name; price_ = price; } string getName(){ return name_; } …

Member Avatar for Agni
0
86
Member Avatar for homeryansta

I'm trying to write a a program that simulates a multi queues, multi server such as a grocery line at the grocery store. The user will enter the desired number of queue/server pair. how would i write this? I mean, I can have 3 - 4 different queue stacks as …

Member Avatar for homeryansta
0
132
Member Avatar for Takafoo

Reverse the case of all alphabetic characters in the string. That is, all upper case characters become lower case and all lower case become upper case. Hello World becomes hELLO wORLD. So I figured I need to use the toupper and tolower commands. I'm just not to sure how to …

Member Avatar for Takafoo
0
65
Member Avatar for wonder_laptop

hello there, can anybody please give me an example of how to use hashtables to implement a memory in cpp.. i surfed the net for 2 hours and couldnt find anything :S im not sure whether im submitting the right queries. thank you.

Member Avatar for VernonDozier
0
73
Member Avatar for Brandon515

ok well first of all i was going to use "a push in the write direction" for the title but i decided it was too stuid haha anyway umm as I am one for pointless trivialities i want to code a program that rains streaming data from the top of …

0
59
Member Avatar for blackbyron

Hello, i have a question for my C++ program. void GasPump::setHighGal(int gallons){ gallons = 0; } void GasPump::setMedGal(int gallons){ gallons = 0; } void GasPump::setLow(int gallons){ gallons = 0; } Those functions will sets the quantity of gas in the indicated tank to parameter value,resets total cash for that type …

Member Avatar for blackbyron
0
95
Member Avatar for theseed

Hi, Does someone know about drawing a window in a Memory Device Context, I need this so I can then read pixels from a window that is behind other windows. I need this for windows XP, not Vista. Thx in advance.

Member Avatar for William Hemsworth
0
32
Member Avatar for neelima156

Hi There, I have to do this read a list of names from an input file of my own, In main() I declared a Namelist[][] object, read several names from thefile using redirection and then print out the list. I have to add the name to the list only if …

Member Avatar for neelima156
0
129
Member Avatar for wonder_laptop

i want to implement a memory using c++ language. the memory will contain addresses of length 64bits because in my architecture the word is 64 bits. i want to implement it using a set associative array. so i want to create a 2 dimensional array of dimension 8 and 16k …

Member Avatar for Zcool31
-1
86
Member Avatar for sid78669

I have a function which outputs a really long string in a box of defined size. The problem is, after a few lines, I get an error saying that HEAP CORRUPTION has occured and I wrote to a memory beyond the allocated limit. Now, I'm only writing to console and …

Member Avatar for sid78669
0
191
Member Avatar for Mahsa_C++

hello every one here, hoping u're all doing fine. i am face with a wierd error while trying to encode a class about courses and students ( student is itself a class) i'm give this error, and googling seems of no help! [COLOR="Red"]error C2784: 'bool std::operator <(const std::pair<_Ty1,_Ty2> &,const std::pair<_Ty1,_Ty2> …

Member Avatar for Mahsa_C++
0
93
Member Avatar for bluebird

Hello! I am writing c++ program on linux. Whenever I read a char or string, I got problem. In c, I sove the problem using if(getchar()=='\n') in c++, how can I sove that problem? Here is my program. I cannot do any input for name. Please help me. [code] #include<iostream.h> …

Member Avatar for mvmalderen
0
96
Member Avatar for abby2589

[TEX]can someone teach me how to use pointer in this program?? i dont know if what i did in this program is correct. can you tell me how to use pointers here.thanks! [/TEX] [CODE]#include<stdio.h> #include<iostream.h> struct fruits { int apple; int banana; int orange; int jackfruit; } fruit; int shape; …

Member Avatar for mvmalderen
-2
151
Member Avatar for aidy

[TEX]quick question, I can't figure out how to change the position doing it this way. It isn't changing position.[/TEX] [CODE] this->a1->Location.X = this->a1->Location.X + 20; this->a1->Location.Y = this->a1->Location.Y + 20; [/CODE]

Member Avatar for mvmalderen
0
81
Member Avatar for sampsont

I've programmed a lot with C but just started a new job using C++. If you could point me in the right direction, I would appreciate it. I made a bare-bones example that shows my problem. Here's what I'm trying to do in words: I have a class called 'Top' …

0
55
Member Avatar for Emerald214

When creating a new object, i can't decide to use "static allocation" or "dynamic allocation". Ex: [CODE] class A {...}; int main() { // A theObject; // or A theObject = new A(); ? } [/CODE] In some more complex cases, i don't know what i should do. Ex: Use …

Member Avatar for nucleon
0
97
Member Avatar for cloud21

Hey guys. How may I implement a high/low card game using inheritance, any ideas out there? Sorry I am a bit of a newbie to all this stuff. Help very much appreciated !

Member Avatar for VernonDozier
0
204
Member Avatar for soulreaver20500

Hi, i have been working on trying to do this for a while now. I applied for a job in c++ and the person gave me a task to test my skill... needless to say that i didn't get the job but i am still working on it to figure …

Member Avatar for Ancient Dragon
0
100
Member Avatar for Gerlan

Hey, I have a small problem. I need to convert a char into an int, except the char has 2 values inside it. For example [CODE=c++] char c = 'v0'; int i = c - '0'; cout << i << "\n"; [/CODE] All that does is removes '0' from the …

Member Avatar for Gerlan
0
205
Member Avatar for maru2

How can I use very long STL vectors? I need to write a code where I use the vector container to store a very large number of values, and I need to access the elements using [i]. I am currently using [i], where i is an integer. How can do …

Member Avatar for StuXYZ
0
211
Member Avatar for cassie_sanford

I am writing a program that is supposed to calculate how much a person earns in a month if the salary is one penny for the first day, two pennies for the second day, four pennies for the third day, and so on with the daily pay doubling each day …

Member Avatar for VernonDozier
0
2K

The End.