49,761 Topics
| |
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' … | |
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 … | |
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 ! | |
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 … | |
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 … | |
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 … | |
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 … | |
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. | |
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 … | |
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> … | |
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, … | |
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 … | |
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 … | |
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 … | |
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 … | |
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 … | |
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 … | |
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.... | |
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 … | |
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) … | |
help needed to solve this series E(x)=1-x^2/2!+x^3/3!-x^4/4!+x^5/5!+.................... | |
[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 … | |
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; … | |
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 … | |
Hay!! can anyone help me by telling how 2 import images in c++. I'm bit of new to this language :icon_confused: | |
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 … | |
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 … | |
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 … | |
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 … | |
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 … |
The End.