49,761 Topics

Member Avatar for
Member Avatar for Phil++

What are instance variables please? Also, is this a good explanation for Encapsulation: Encapsulation or information hiding is all about hiding the details of the implementation of the interface. Encapsulation is used to prevent users from viewing the inner workings of the interface. A real life example of Encapsulation is …

Member Avatar for Tom Gunn
0
100
Member Avatar for surfer2009

i am new in programming . i have a clock code. but want to modify it. when user press "0" it increment in time by 5min and when press "1" increment time by 10 min _______________ [CODE]//The complete program listing of the program that defines //and uses the class clockType …

Member Avatar for Kashaku
0
1K
Member Avatar for Phil++

Hey, I'm just wondering if it's possible to run an if statement through a class? The thing is, I wanna store users details and then when you search for a user, i.e "Phill" it returns all the information on that user. I'm using something like: [CODE] c1.GetName(); [/CODE] So something …

Member Avatar for Nick Evan
0
90
Member Avatar for neithan

[ICODE] * Don't use system("pause") to pause your program if possible. Use getchar( ) if you are using C and cin.get( ) if you are using C++. [/ICODE] Why is that? A reasonable explanations for those tips would help to learn.

Member Avatar for marco93
0
672
Member Avatar for ChaosBG

Hey guys i've tryed to find how to do this the best way but it failed. So i want to ask the experts here: How to add a new line of text to a edit control. Example: I have alredy some text in the edibox and i want to add …

Member Avatar for marco93
0
393
Member Avatar for amit.kumar

Please spot the errors and right the correct code back . Thanks in advance amit kumar[code]#include<stdio.h> #define max 10 typedef struct { char entry[max]; int top; }stack; int stackfull(stack *s) { if(s->top==max) return 0; else return 1; } int stackempty(stack *s) { if(!(s->top=-1)) return 0; else return 1; } void …

Member Avatar for mrnutty
0
108
Member Avatar for killerqb

My code is an expression tree program, in which I make treenodes pointers and push them in the end all into the 1st spot of a stack, in which is declared in my header file of the program. I wipe all the treenode pointers with a recursive traversal. Is this …

Member Avatar for csurfer
0
72
Member Avatar for Damirz

[B]Hello![/B] I am writing a c++ code for displaying a 3D cube. I have some small problems with arrays. I want to initialize just some interval of array. Example: [COLOR="Green"]int array[10][10]=0; //now I want to initialize just an interval array[0][5] TO array[0][8]=1;[/COLOR] ___________ I know that in place where the …

Member Avatar for mrnutty
0
237
Member Avatar for Jennifer84

I wonder something about finding a specific character in a string. What I am trying is to find "*" and if that character is found in the string, I will write "Found" to a file. When running the code below. All this is happening but the same thing is happening …

Member Avatar for dpreznik
0
145
Member Avatar for CPSIT

An International market maker seeks C++ and C# developers to build out proprietary trading applications in both a windows and Linux environment. This firm has been growing steadily over the past couple years and have open development roles on their Market Data, Connectivity, Business Intelligence, GUI, Data Analysis and Speed …

0
46
Member Avatar for leoni

Hi all!! I'm using stl map to store some data here is the example: [CODE] struct MapKey { int i, j; void Set(int pI, int pJ) { //this guarantee that i is always lesser than j if (pI < pJ) { i = pI; j = pJ; } else { …

0
58
Member Avatar for nikhil91

Hello...i m nikhil i m student of comp engg. Nw we are doing work on project..but we hav some problems in it..i request u ..plz help me in my project i send u..my project nmae..plz give me fast reply...m waiting for u r reply.... MY SUBJECT QUESTION IS Que: My …

Member Avatar for matome
-4
71
Member Avatar for Phil++

Hey, I'm trying to do a class for a games program, basically it will allow me to enter games into the class. Here is the code (It won't work) [CODE]#include <iostream> #include <windows.h> using namespace std; class Games { private: char game_title; char game_cost; char name; public: void set_values(char name, …

Member Avatar for dkalita
0
80
Member Avatar for Reprise

My code so far opens a text file in a particular format and reads in the data into a structure called salesRecord. There is no problem there. The problem arises when I write the data to a new binary file. Here is the structure: [code=CPP] struct salesRecord { int custNo; …

Member Avatar for dkalita
0
8K
Member Avatar for NICEGUY123

I need some help passing a array of integers into a hash table by chaining. So if the array is filled it that location it will go to a linked list of the index. any ideas on how to get this done. This is what i have so far. [CODE]chainFunc(int …

Member Avatar for VernonDozier
0
94
Member Avatar for kiranpreddy05

[code=c++]class StripChartWindow : public PegDecoratedWindow { public: StripChartWindow(const PegRect& Rect, const PEGUINT TitleId); virtual ~StripChartWindow() {} virtual PEGINT Message(const PegMessage& Mesg); private: PegStripChart* mpChart; PegStripChart* mpChart2; PEGUBYTE mID; PEGUBYTE mSin; PEGUBYTE mID2; PEGUBYTE mSin2; };[/code] This is the part which is givin me errors as below... error C2143: syntax error …

Member Avatar for kiranpreddy05
0
254
Member Avatar for hodaAgh

I've written a program like the follow: [CODE]int main () { . . . . ifstream file1; ifstream file2; ofstream simiralities; simiralities.open("P(0)_P(1).txt", ios::app); file1.open("test1.txt", ios::in); while (!file1.eof()) { . . . file2.open("test2.txt", ios::in); while (!file2.eof()) { . . . . } file2.close(); } simiralities<<number; file1.close(); simiralities.close(); return 0; }[/CODE] the …

Member Avatar for hodaAgh
0
144
Member Avatar for naej
Member Avatar for NinjaLink

I am currently having problems with my getline in main. Whenever I use it, it prints out the last word in my input file twice. I do not know how to get rid of it. Any help is appreciated. [B]Input file:[/B] noon dog race car cat mom bob [B]Current Output:[/B] …

Member Avatar for NinjaLink
0
96
Member Avatar for kaylalail

I am a student in a computer programming class. I was instructed to write a program that would allow the user to input numbers and the program would output the sum of those numbers. I wrote the program up but keep getting this error message: error C2447: '{' : missing …

Member Avatar for csurfer
0
85
Member Avatar for haven_u

hi there, i just want to know what data type i need inorder to store a binary word eg. 10010111

Member Avatar for vmanes
0
874
Member Avatar for MeBjess

I am having problems completing this program. I have included my notes, and stated current problems in the beginning. Please help. I have no idea what I am doing. This is all I have accomplished in 4 days! I am new to programming, well relatively, it was nearly 17 years …

Member Avatar for MeBjess
1
115
Member Avatar for ross42111

[QUOTE]THe problem is supposed to give the recsive answer and the loop answer. The recusive anwer is always giving 0 - as its answer.and that is inccorrect It is supposed to show the steps and so is the loop answer. Can someone plase help me[/QUOTE] [CODE]#include<iostream> using namespace std; float …

Member Avatar for Lerner
0
148
Member Avatar for martinandrade

I have an assignment due tomorrow and I haven't being able to do it. I do not understand nothing about classes and when to use them. My assignment is: (Account Class) Modify class Account (Fig L 3.1 and Fig L 3.2) to provide a member function called debit that withdraws …

Member Avatar for martinandrade
0
948
Member Avatar for ubuntuubuntu

Hello, I have a program, let's say foo.cpp . If I do "g++ -S foo.cpp". That generates the file "foo.S" with assembly code. I would like to compare the assembly code foo.S with the assembly code generated if I put foo.S in a c program (even though there should be …

Member Avatar for gerard4143
0
326
Member Avatar for Ilija

Hello. I`ve been given to make a program for math.After checking it.. it confuses me.I`ve been searching for a solution about my program.I hope u`ll help me with this program.

Member Avatar for mrnutty
0
63
Member Avatar for osgiedeprof

good day everyone there's something i've been trying to do in c++ its a program that finds the mean median and mode from a group set of data, it should use vectors to read these data from the user and then tabulate into: grade distribution class mark(x) fx i've tried …

Member Avatar for mrnutty
1
104
Member Avatar for daviddoria

I am looking at some open source code and I am a bit confused. There is an Allocator class: [code] class Allocator{ [/code] Then in another class, they have: [code] class Octree{ public: static Allocator<OctNode> Allocator; [/code] When trying to compile, I am getting: [code] error: declaration of 'Allocator<OctNode<NodeData, Real> …

Member Avatar for StuXYZ
0
104
Member Avatar for surfer2009

i am doing a problem . take character dynamic of size 10.when user enter 11th element.it increment the array size to 20. when user enters 21st element array size increases to 30 and so on int main(){ char *p; p=new char []; int size; for(int i=0 ;i<10; ++) cin>>p; size=strlen(p); …

Member Avatar for mrnutty
0
102
Member Avatar for jupitertrooper

Ok, I am newish at programming in c++ and am doing a computer science program in school. For my latest project I have come to a bit of a dead end and was hoping for some help with loops and ignoring characters. The program is quite simple, it is a …

Member Avatar for jupitertrooper
0
130

The End.