49,761 Topics

Member Avatar for
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
98
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
205
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
206
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
212
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
Member Avatar for winrawr

What editor/compiler does everyone use, and, what is your syntax highlighting like? I'm using programmer's notepad 2, with a gcc win32 port... with a stylish green-identifier, gray-text, white-operator, blue-comment, red literal on black background.

Member Avatar for monkey_king
0
135
Member Avatar for sid78669

Hello everyone, I am having trouble with a part of my Assignment and think i am missing something here. I have a Field class as below: [CODE=C++] class Field{ char * fstr; int frow, fcol, len, fslen, foffset, fstart, fctype; bool fedt; static int finsert; public: Field(char * str, int …

Member Avatar for sid78669
0
451
Member Avatar for siri_lito

hi can anyone help me i have the code that checks the word entered a palindrome or not it works in visual c++ but when i run the same in unix it is giving me errors can anyone tell me how to run it unix plz..... #include <iostream> #include <string> …

Member Avatar for sophia77
0
323
Member Avatar for aagomez

I am currently having problems updating a public data member that is a vector of pointers. I have a class called node, that has a public data member called list. list is [icode]std::vector< node<T>*>[/icode] and should contain pointers to other [icode]node<T>[/icode] objects. I am trying to overload the assignment operator, …

0
51
Member Avatar for MegaDave

I've been checking forums alot lately, and it helped me in more than once while facing some C++ stuff. and my first time posting. Anyway, am having an assignment where i need to decode and encode a ZipCode, the input of the BarCode should be as a string. BarCode contains …

Member Avatar for Ancient Dragon
0
309
Member Avatar for sbasaran

I used Visual Studio's tools for reporting memory leaks. Main program uses a dll. In main program it reports the file name and line number: [color=blue] d:\tmp\ali\ali\ali.cpp(47) : {200} client block at 0x003A84C0, subtype 0, 5000 bytes long. Data: < > CD CD CD CD CD CD CD CD CD …

Member Avatar for sbasaran
0
296
Member Avatar for blackbyron

Hello guys, I am new to this forum and I'm going to put my code here. [code=cplusplus] #include <iostream> #include <string.h> using namespace std; const int MAX_ACCOUNT = 12; const int zero = 0; bool validAcctNumber(int acctNum, int size); bool checkAccountUsed(int acctNum, double check[]); bool saveAccountUsed(int acctNum, double save[]); void …

Member Avatar for blackbyron
0
138
Member Avatar for yangty152

I am doing my school project, and I cannot copy the linked list correctly. When I assigned temp to this, nothing happens. I believe I put all the related code below, any help will be appreciated. void poly::read () { // Pre: None. // Post: A new value is read …

Member Avatar for yangty152
0
183
Member Avatar for erialclaire_238

anyone here who can help me on this? I need to create a program that can output the location of 5 inputted values. sample input/output; enter 5 values: 4 5 9 8 3 enter no to search: 8 8 found in location 4 HOPE YOU GET IT> pls give me …

Member Avatar for erialclaire_238
0
316
Member Avatar for Vallnerik25

I have some more basic questions about using overloaded operators. This is just a hypothetical question. Say I have 2 overloaded operators functions defined for a class. The overloaded operator= function and the overloaded+ function. Now I want to create the overloaded operator+=. Can I define that function in terms …

Member Avatar for Vallnerik25
0
137
Member Avatar for nitheesh.89

Hi .. I need a c++ program dealing with sales and marketing ... the program should contain some products where we enter the details of sales and it should yield a result of product as gud or a bad sales as profit....

Member Avatar for siddhant3s
0
91
Member Avatar for ammaranasir@hot

Hi.. I am really new in C++ and I ahve no idea how to create a project? I have an assignment n i donn't know how to do it? can u plzz help me in it? Title Cost of buying PC & other PC components in unitar (University). - Choices …

Member Avatar for Lerner
0
61
Member Avatar for onlymsfrance

Hello there! So I have created a project for school. I have this program running without errors. The problem is it doesn't perform the math. Any ideas or suggestions? Here is the output when ran...and the code as well. Please choose your operator : + (addition) - (subtraction) * (multiplication) …

Member Avatar for WaltP
0
77
Member Avatar for trinity_neo

help needed to solve this series E(x)=1-x^2/2!+x^3/3!-x^4/4!+x^5/5!+....................

Member Avatar for siddhant3s
0
171
Member Avatar for winrawr

[code=cpp] #include<iostream> using namespace std; int main(){ int a; int b; asm("jmp c\n\t"); a=7; b=12; asm("d:\n\t"); cout<< a<< endl<< b<< endl; return 0; } int pewp(){ int a; int b; asm("c:\n\t"); a = 3; b = 2; asm("jmp d\n\t"); } [/code] this will output [code] 3 2 [/code] what I …

Member Avatar for winrawr
0
104
Member Avatar for kavithabhaskar

HI I am trying to work on a very simple recursive function but i get o/p as some negative values.. can u please help and tell me what mistake i am doing ? [CODE]#include<iostream.h> void countdown(int x) { using namespace std; cout<<x<<endl; countdown(x-1); } int main(void) { countdown(10); return 0; …

Member Avatar for siddhant3s
0
157
Member Avatar for moshe5

So the assignment is to create a Sorted Linked List, not doubly, and not using a tail. I am using a SortedListNode Struct in the private area of the SortedList class. I think this is causing problems. I have the logic, and I was on the verge of succeeding, but …

Member Avatar for moshe5
0
257
Member Avatar for pamod

Hay!! can anyone help me by telling how 2 import images in c++. I'm bit of new to this language :icon_confused:

Member Avatar for William Hemsworth
0
60
Member Avatar for mikhala99

I am totally stuck. I have worked on this for a week. I clean up the bugs and find more. It didn't look too hard to start with. I have to write an OOP program that displays the default info and then asks users for input. I have two headers …

Member Avatar for mikhala99
0
77
Member Avatar for snap!

Ok, so im having trouble with this program and dunno where to start, or end. if anyone is bored and can help out would be great. 1. The regular rate for a call is $0.10 per minute 2. Any call started at or after 6:00pm (1800 hours) but before 8:00 …

Member Avatar for StuXYZ
0
91
Member Avatar for ellimist14

Following are my prototype definitions: [code] int fillArray (double commission[], int salesID[], int employeeCode[], int numUnits[], double numDollars[]) ; void printReport (ofstream& fout, double commission[], int salesID[], int employeeCode[], int numUnits[], double numDollars[]); void printHeader (ofstream& fout); [/code] The two void functions are the one's that I'm getting errors on …

Member Avatar for nucleon
0
150
Member Avatar for ace_dman

Right now Im still beggining to learn the idea of pointers,basically I just want to ask a question about the code I have found, I mean I want to know what is happening right here...the comments on the code serve as my question just look at below... [CODE=cplusplus] #include<iostream.h> struct …

Member Avatar for ace_dman
0
99
Member Avatar for nuclph

Hi all, Suppose, I have the following classes B, D1 and D2 as defined below. Also, I have function test which have only pointer to the base class and say key which will tell D1 or D2 to create. void test(B *b, const std::string &key) { ... } I would …

Member Avatar for nucleon
0
80

The End.