51,593 Topics

Member Avatar for
Member Avatar for yaee

Create a class named Order. This class has the following attributes/ data members i) OrderID ii) Items iii) PricesOfItems a) Create the object of this class using parameterized constructor in order to initialize OrderID and Items data members. Default values of both the data members must be equal to 1. …

Member Avatar for orwell84
0
115
Member Avatar for xonxon

[code] Computer::Computer() Computer::~Computer() void Computer::setspeed ( int p ) [/code] what is this 3 sentences mean? what is the purpose we use it? i have asked my friend but still a bit blur. pls help.thanks.

Member Avatar for xonxon
0
70
Member Avatar for yaee

Write a function to overload subtraction operator for Class Order, which you created in previous question. The class has following attributes/ data members i) OrderID ii) Items iii) PricesOfItems Write the main () to call the - operator and print the result also. This operator should subtract the items of …

Member Avatar for Comatose
0
242
Member Avatar for britto

help needed..... i trying to write a c compiler in java but im a newbie in compiler design....... i know the phases of compiler is there any classes in java for implementing these phases?????? is there a source code for c compiler written in java?????----open source thanks in advance

Member Avatar for Salem
0
91
Member Avatar for rudasi

Hello, I just had a midterm and there was a question where we had to right a program which can calculate all the numbers which form quadruplets. A quadruplet would be x^3+y^3+z^3=a^3 The program should only run till a<25 also, 0<x<y<z<a at the end we had to output how many …

Member Avatar for siddhant3s
0
208
Member Avatar for ellimist14

ok this is a really basic question but I just can't seem to wrap my head around it. The basic syntax of how to open a file and check it and whatnot makes sense to me. But how the compiler reads from the file doesn't. For example if I have …

Member Avatar for siddhant3s
0
126
Member Avatar for FyerEgg

Ok, so I decided to try and write a simple chat bot. To start, I made it so he will scan the string that you input, and see what emotion you have. (this is just the base, eventually he will read verbs and such) So, here is the code... [CODE]#include …

Member Avatar for ArkM
0
152
Member Avatar for tomtetlaw

I have looked all through the open gl website and i cant fine where to download the SDK? can someone give me a download link? i am using c++ btw

Member Avatar for hasbro
0
85
Member Avatar for orwell84

I am writing a program that will take input and find whether or not the number you put in is prime. The program works fine, save for one small problem: [code] #include <iostream> using namespace std; int main(){ int num; //the chosen number int i; //potential factors do{ cout<<"Input a …

Member Avatar for siddhant3s
0
128
Member Avatar for Taniotoshi

Hello everybody I am doing a little code to learn a bit more about C++. Do not be amazed if you find that code useless, it is mainly just for me to improve. :) This is my first C++ program and I started few days ago... [/I]One class is used …

Member Avatar for Taniotoshi
0
617
Member Avatar for Dinomike1000

Hello - I have a question about inheritance and polymorphism in C++. If one is making heavy use of inheritance and using a lot of pure virtual and plain virtual functions, are there any common practices for avoiding having the virtual functions staggered in confusing ways. By that I mean …

Member Avatar for Rashakil Fol
0
112
Member Avatar for britto

hi everyone..... how to create a c compiler using c language.... can anyone explain the steps involved..... thnx in advance

Member Avatar for MosaicFuneral
0
431
Member Avatar for blahblah619

Can anyone help me figure out what I'm doing wrong. I'm new to programming and for my class we had to modify the program so that it reads its input from a text file and the output of the program should go to the screen -- only the input is …

Member Avatar for siddhant3s
0
271
Member Avatar for mtramnes

Wrote this max min problem. The output however gives me the correct max but not the correct min. It simply returns 0 for the min everytime. Any ideas what I need to fix? [code] #include "stdafx.h" #include <iostream.> #include <conio.h> using namespace std; int main() { const int NUM_DAYS = …

Member Avatar for vmanes
0
119
Member Avatar for viki0077

Can anybody give me some tip or help me with some part of this problem, thank you. Write a program which creates N new threads (N is the command line argument). Every thread in the single of M seconds (M is also command line argument) generates random prime number which …

0
71
Member Avatar for colmcy1

Hey all, I'm new to C++ and struggling to write a program. I am used to writing in VBA and Mathlab but because I need to run a long run simulation have to rewrite my program in C++. What a am trying to do is if I have a list …

Member Avatar for colmcy1
0
98
Member Avatar for colmcy1

Hey all, I'm new to C++, much more at home with mathlab or VBA so this is probably a simple problem for you guys. I am writing a program and I want to change values at the end of loop but keep answers from previous loop, i.e. in other programs …

Member Avatar for colmcy1
0
123
Member Avatar for jeevsmyd

The following is a code that my teacher gave me .. I dont know the working of files in c++ :( this program is supposed to copy a datafile into another.. but its is not working ... many many errors.. fname1 and fname2 are already existing files,right? or fname2 is …

Member Avatar for siddhant3s
0
107
Member Avatar for kartheepanmirra

hi all im tryting to create a wrapper dll for my java program which must decompress data using gzip.dll decompress algorithms.well its the same as c++ calling a dll thread posted my myself.using the help of user kbw i have made great progress.well but still i m not able to …

0
53
Member Avatar for mimita

Hello, I'm really a beginner in programming, and i might need you're help. I have an array[position][3] with fixed coloumns Position is from 0 to 99 an it looks like this: array [position][0] = helpFlow; array [position][1] = i; //i=rows of a [10[10]-grid array [position][2] = j; //j=column of a …

Member Avatar for kbshibukumar
1
100
Member Avatar for phillipdaw

The code was written for fun, and it is by far the most complicated program I've written yet. It's also my first step from C into C++. I have some training in algorithms but almost none in coding. It is pretty long and I don't expect anyone to analyze the …

Member Avatar for siddhant3s
0
106
Member Avatar for bhavya_talluri

hi plz help me i am getting the above error here i am attaching the program #include<iostream.h> #include<stdio.h> #include<conio.h> #include<math.h> using namespace std; int main() { int a[10],t,n,pos; clrscr(); //Sorting the elements in the array. Sorting technique name is “Bubble Sort” cout<<"Enter Elements into the Array"; for(int i=0;i<10;i++) cin>>a; for( …

Member Avatar for siddhant3s
0
414
Member Avatar for cppnewb

Hi. I'm making a class in an include file. I ran into some touble...When i try to compile, this is what comes up: [CODE] c:\...\renew.h(25) : error C2660: 'localtime_s' : function does not take 1 arguments c:\...\renew.h(36) : error C2660: 'asctime_s' : function does not take 1 arguments [/CODE] Here …

Member Avatar for cppnewb
0
1K
Member Avatar for jitendra.theta

hello, in the following question c=4; d= (++c)++; //It works in gcc compiler d= (c++)++; //it didn't work what i have read that ++c or c++ returns a value which can't be again incremented or decremented (like 5++). i want to know how the first statement works and second statement …

Member Avatar for siddhant3s
0
107
Member Avatar for MentallyIll5150

I am constructing a class "dequeint" of integers and using circular queue storage. I get my code to compile but its output is garbage? Please HELP! .h [code] #include <iostream.h> #include <stdlib.h> const int MAXSIZE = 10; typedef int NodeType; class dequeint { private: NodeType NodeArray[MAXSIZE]; int headi; //head in …

Member Avatar for MentallyIll5150
0
163
Member Avatar for Fouly

Hi, I'm trying to pass parameters to an exe file using C++...i tried the following code: [code] system("FileName.exe"); [/code] but this command line just fire the .exe file without passing any arguments... Thanks, Mostafa Fouly

Member Avatar for siddhant3s
0
688
Member Avatar for arpeggio54

I have this Instance of class A, which i first assign, then assign again, but the compiler calls the destructor AFTER they class has been constructed the second time, why? [code] class A{ public: int *Int; A(int b) { Int = new int(b); cout << "CONSTRUCTOR " <<endl; }; ~A() …

Member Avatar for siddhant3s
0
123
Member Avatar for tux4life

I'm fairly new to C++ programming and I would like to ask you a (maybe strange) question... The code below compiles correctly with both: - the latest MinGW-compiler - Borland C++ Builder Compiler 5.5 (from the free Command Line tools) However if I run the program (after compiling with the …

Member Avatar for tux4life
0
368
Member Avatar for Lotus_2011

I made program take number from user then display the factorial of this number >>>> The program works well but if I enter 20 it crashes. I need help how to accept big number in my program ?????? This my program [CODE]#include<iostream> using namespace std ; long long Fact(long long …

Member Avatar for siddhant3s
0
110
Member Avatar for di mo

Hey i have a code where i want to add/subtracrt 2 big integer. But i don't know how to do the carry thing. Does anybody has an idea? Here is my Code: [code=c] #include <iostream.h> #include <string.h> #define SIZE 40 class Huge { public: Huge(); void menu(); void rules(); void …

Member Avatar for di mo
0
457
Member Avatar for teddycow

Hey. I'm currently working on a project where I'm suppose to read album titles including song names from a file into a 2d array. When I input the cd number, only that record should show up in the console. E.g. Cd number: 1 Album title Song 1 Song 2 Song …

Member Avatar for teddycow
0
120
Member Avatar for arpitha_ks

hi, I am trying to declare a 2D array in a member function in C++ , where its size changes everytime i run the program. but it is giving error like " a constant expression is required " but i cannot make the size constant, as i need to change …

Member Avatar for siddhant3s
0
87
Member Avatar for nagha3

Hey everyone, My problem is that I have a program which is to be used for teachers. One of the functions I am implementing is a SearchStudent function. Basically it checks a multidimensional array I created called MyClass[MaxSize,MaxGrade], MaxSize being the amount of students that can input into the program …

Member Avatar for Ancient Dragon
0
107
Member Avatar for Tyrick

Say I had a program running... like I was in the middle of entering 100 numbers into an array... is there a way I could program it so that one the user hits a key, say "cntrl-A", that the process will stop? Additionally, I was reading these lecture notes and …

Member Avatar for vmanes
0
87
Member Avatar for DemonGal711

Ok, it's a little weird, but I'm basically trying to write a piece of code that would determine how many letters are different between two words, like cat and cot are off by one yet cat and dog are off by three. So, I have a vector that contains all …

Member Avatar for DemonGal711
0
104
Member Avatar for bugmenot

Please correct the error in my program. When i run the program on turbo c++ 3, it output 3 times. Also When i enter more than 1 entry only the last entry is outputted. Also it is outputted 3 times. [CODE]#include<fstream.h> #include<iostream.h> #include<conio.h> class student { int rollno; char name[20]; …

Member Avatar for r.stiltskin
0
187
Member Avatar for BruenorBH

I am trying to create a thread to continually update the time in the textbox. The issue is how do you reference a textbox in that was created in the main section of the program? main.cpp [code=c++] #include <windows.h> #include <ctime> #include "resource.h" static bool keepRunning = true; static HANDLE …

Member Avatar for BruenorBH
0
149
Member Avatar for bugmenot

I have a very similar assignment in which we have been specified that we are NOT allowed to use vectors. Is there any other way in this case to count the number of lines of data within a text file??

Member Avatar for Ancient Dragon
0
136
Member Avatar for christiangirl

Hello, I am getting 8 8 8 7 7 8 6 7 8 9 as output when I enter 1 2 3 4 5 6 7 8 9 0 into this program. It is supposed to sort the numbers one through 10. I debugged it, and believe the problem is …

0
82
Member Avatar for jamboadams

hey anyone know what the largest value that can be stored in an integer variable is? likewise is there a double / long type of deal that isnt of float type? thanks

Member Avatar for vmanes
0
1K
Member Avatar for daviddoria

I want to do something like this [code] template <class T> vector<T> DereferenceVector(vector<T*> &PointerVec) { vector<T> ObjectVec; for(unsigned int i = 0; i < PointerVec.size(); i++) ObjectVec.push_back(*PointerVec[i]); return ObjectVec; } [/code] and call it with [code] void TestDereferenceVector() { vector<double*> a(10); vector<double> b = DereferenceVector(a); } [/code] That seems to …

Member Avatar for daviddoria
0
107
Member Avatar for BattlingMaxo

I am developing an aquarium in C++ the fish will move by algorithms only, no keyframing. here is my question: exporting the fish model from Blender ( a 3d modelingpackage) that it could be imported into my program with all the bone structure and vertex weight information included. is that …

0
60
Member Avatar for MyRedz

here's my question here Construct a class named Coord that contain two floating –point data member named xval and yval , which will be used to store the x and y values of a point in rectangular coordinates. The function member should include appropriate constructor and display functions and friend …

Member Avatar for siddhant3s
0
134
Member Avatar for greg022549

I am just learning how to use C++ and I am anxious to do so.. I need help with working with double selection if statements. Here is what I am trying to accomplish with in my program: If a client selects to travel to Japan he is charged a flat …

Member Avatar for vmanes
0
90
Member Avatar for urbandad70

I am working on another thread, but I encountered a problem just testing importing into an array. I use this code and it just hangs. I am stuck, please help. FYI, the scores.txt is in the same location as the source code. [code] #include <fstream> #include <iostream> #include <cstdlib> #include …

Member Avatar for jencas
0
144
Member Avatar for ronicasingh

Hi all professionals, I am just an amateur compared to most of you. I am contemplating starting an extremely lengthy program, just for my own purpose, which basically does a holiday reservation to whichever and whatever place in SA, for now. I am just thinking this idea for building up …

Member Avatar for jencas
0
104
Member Avatar for acardiac

I have written this program and i am facing problems in the SearchRec() and DelRec() function.....SearchRec() function is supposed to search for a record on the basis of the pptno provided and if found would return 1 else it would return 0(but it is no working).And the DelRec() function should …

Member Avatar for Ancient Dragon
0
242
Member Avatar for Dendei

hi i got an problem about reading my files i want to decide which file to open in the program not before anyone now a solution? :) [CODE] string fil; cout<<"which file? : "; cin>>fil; ifstream myfile(fil); [/CODE] cant see why this dont work...

Member Avatar for Dendei
0
100
Member Avatar for meistrizy

Thanks in advance for your help. I am supposed to create a program that allows user input for a code. The program will then read the array and output the letter on the keyboard one character to the left of the inputted strings. I am first trying to get the …

Member Avatar for meistrizy
0
166
Member Avatar for AnGuRuSO

This is pretty damn embarassing, I've been programming for a really long time and have been defeated by a trivial problem. [code] #include "stdafx.h" #include <string> #include <iostream> #include <stdio.h> using namespace std; int main() { int choice = 0; string itemDesc; double itemPrice; cout << "1. Process a sale" …

Member Avatar for AnGuRuSO
0
125

The End.