49,757 Topics

Member Avatar for
Member Avatar for Enjoy

Hi all, In graphics mode, I need to read hexadecimal value from a file and assign it to variable for which i can add other value later. Eg : I need to read value 1007(hexadecimal) from a file and assign it to a variable. Later when i add 3 to …

Member Avatar for mathmagic
0
221
Member Avatar for chts12345

Hi all Is there anybody who can solve this problem? This is not a easy problem. Problem: Assume that George(S,X) is a function that returns a Boolean value, where S is a stack, and that the time complexity of George is O( log |S| ) , where |S| is the …

Member Avatar for jephthah
0
135
Member Avatar for dgr81

I am getting compiler output that makes me think I have some sort of syntax error like a missing ';' or misaligned (). But I've checked my code thoroughly and can't find anything wrong. What else could cause this kind of error? I included the compiler output along with my …

Member Avatar for dgr81
0
312
Member Avatar for R3B3L

Hello Everyone. Project outline: [QUOTE]I've to make a project which is the following: I'm a Car Distributor that distributes(sells) cars to different Car Dealers I should have a stock class with all the different types of cars I have ej(Toyota: 100, Mistubishi: 220, etc...) each type of car should have …

Member Avatar for R3B3L
0
126
Member Avatar for superjacent

I'm self studying from the book, C++ Primer Plus Fifth Edition, by Stephen Prata. The following relates to Chapter 13, Page 699, Programming Exercise #4. One task is to write the derived class method definitions based upon the given prototypes. The following are the said prototypes. [CODE="cpp"]class Port { private: …

Member Avatar for superjacent
0
183
Member Avatar for nurulshidanoni

I cannot compile my programming..abnormal programming..anybody whi knows where is my mistake? [code=C++] { int count, k; { count=0; myfile<<"i,j|"; for ( int i = 1 ; i < students.size (); i++ ) for ( int k = 1;k<students.at(i).examcode.size(); k++ ) { count=0; for (int colHead = 1; colHead <students.at …

Member Avatar for nurulshidanoni
0
131
Member Avatar for Saaddani

We're learning about functions in Intro to C++ and a problem is telling me my getInput() function is supposed to "get the user's weekly payrate" but at the same time it also says "remember the getInput() and displayInfo() functions are void." How can I get input if there the function …

Member Avatar for Ancient Dragon
0
125
Member Avatar for kireol

I've been trying different things all weekend trying to figure out what is going on here. If I log in to my server via a PC and telnet, it comes through just fine. So I know it's my code here is messed up. Here's my code [CODE] while(1) { mbstowcs(CHAT," …

Member Avatar for kireol
0
117
Member Avatar for Squeeker

Can an Interface file contain multiple classes? If so how would one implement this interface file (what specifications do you need to use to specify which class you are using)? If this is not legal or is a bad programming practice then please explain why. Thank you, Arielle

Member Avatar for Squeeker
0
152
Member Avatar for hafhag

Thank you for your advancing helping. I do have a problem in how to encode a bank account that has : 1. account number,user name , intial deposit and balance (updatable) 2. that a specific user can see his balance 3. a user can withdraw money 4. a user is …

Member Avatar for hafhag
0
231
Member Avatar for madfrenzy

hey I'm trying to run this program on netbeans on Ubuntu #include <windows.h> #include <GL/gl.h> #include <GL/glext.h> #include <GL/glu.h> #include <GL/glut.h> void myInit(void) { glClearColor(1.0,0.0,0.0,0.0); glColor3f(0.0f, 0.0f, 1.0f); glPointSize(9.0); glMatrixMode(GL_PROJECTION); glLoadIdentity(); gluOrtho2D(0.0, 640.0, 0.0, 480.0); } //<<<<<<<<<<<<<<<<<<<<<<<< myDisplay >>>>>>>>>>>>>>>>> void myDisplay(void) { glClear(GL_COLOR_BUFFER_BIT); glBegin(GL_POINTS); glVertex2i(400, 350); glVertex2i(100, 130); glVertex2i(150, 130); …

Member Avatar for Comrade Ogilvy
0
113
Member Avatar for Jboy05

how do I Write a function call WelcomeMsg which displays the message "Welcome back! I wish you have a great Spring Break". Then write a calling statement for it?

Member Avatar for Narue
0
82
Member Avatar for JamesMil

Here's a fairly simple piece of code to get a message from the user, limiting its length to 10 chars. Problems arise when the message is 10 chars or more, and the program enters an infinite loop. I think the problem is getline() leaving somethin on the stream, but I've …

Member Avatar for Narue
0
84
Member Avatar for m2185

I am working on a problem where I must show all perfect integers between 1 and 1000, as well as the divisors to get them. I can get the integers just fine with this code: [code]#include <iostream> using namespace std; void Perfect(int); int main() { for (int i = 1; …

Member Avatar for Ancient Dragon
0
89
Member Avatar for Lord_Polo

I have a txt file where data is arranged in a list eg: 0001 0002 0003 0004 etc... Andy i would like to change specific columns to the same data eg: | 0a01 0a02 0a03 0a04 |

Member Avatar for Lord_Polo
0
108
Member Avatar for dkwantee

hello! I want to know about string tokenizer. i have a file of the following format:- Studentname StudentID Studentgrades each is separated by a tab. and the size of the file is unknown. I have to read each line using string tokenizer..Well, i dont know much about this, can someone …

Member Avatar for Narue
0
81
Member Avatar for daymick

Hello, I would like to apply object-orientated programming in C++ to sets of 3D images. I would like to do 4 classes: -dataset:an array of 3D images, contain the nb of 3Dimages as an object -3Dimage:an array of 2D images, contain the nb of 2D images as an object -2Dimage:an …

0
56
Member Avatar for Run.[it]

Is the only way to stores strings as a variable in C++ is by having an array of type char?

Member Avatar for Run.[it]
0
94
Member Avatar for Lalarukh khalid

hi every body.... i need little help regarding project which we have to made in C++..... can someone guide me tht which type of topices can selected...... i am very much confused....:S

Member Avatar for Lalarukh khalid
0
227
Member Avatar for dophine

Hi all, I would like to know in what situation template is used instead of inheritance and vice visa. examples are appreciated. I just know template is static binding while inheritance is dynamic binding. so if speed is concern, template is better.

Member Avatar for Narue
0
136
Member Avatar for tones1986

Hey folks. I am confused as to how i can make a constructor take zero - or lets say 3 arguments. If i do this in my main.cpp: [code] const Vector v1; const Vector v2(1.0, 2.0, 3.0); [/code] And this in my vector.cpp file: [code] Vector::Vector(double new_x, double new_y, double …

Member Avatar for dophine
0
89
Member Avatar for Ripture

First of all, forgive the corny title, I couldn't resist once I thought of it. ;) I have a small assignment for a statistics class that had been giving me a little bit of trouble. How we did the assignment was left up to the students since it is a …

Member Avatar for vmanes
0
123
Member Avatar for stackOverflow

Hi all, In graphics mode, (using bgi).. is there any function like the printf statement when with %x gives the hexa equivalent??

0
82
Member Avatar for Lensva

[code] #include <iostream> using namespace std; class fibonacci { private: int num; public: long fibNum(int n); fibArr(); }; //============================ long fibonacci::fibNum(int n) { n=num; if (n<0) { return 0; } if (n<2) { return n; } else { return fibNum(n-1) + fibNum(n-2); } } //============================ fibonacci::fibArr() { int *Arr; Arr=new …

Member Avatar for Lensva
0
122
Member Avatar for technogeek_42

can any one knows how to convert a number to word like this 192 to one hundred ninety two i can't get the logic of that who can suggest of that i can't solve that.. plz help me

Member Avatar for technogeek_42
0
715
Member Avatar for Serling1

I'm trying to have a getData function transfer all the objects it is holding in its array to a new array so that the new array can be used in a friend function to print the objects' information. [CODE]void Set::getData(Set& tempSet) const { for (int i = 0; i < …

Member Avatar for Necrolis
0
446
Member Avatar for monroe85

#include <iostream> using namespace std; int main(){ double w,x,y,z,avg; cout <<" PLEASE ENTER FOUR ENTRIES OF MARKS"<<endl; cin >> w >> x >> y >> z; avg=((w+x+y+z)/4); if(avg>60){ cout <<"YOU PASS"<<endl;} else{ cout<<"YOU FAIL"<<endl; } cout<<"YOUR AVERAGE MARK IS "<<avg<< endl; return 0; }

Member Avatar for Necrolis
0
71
Member Avatar for harisshafiq

A machine with 32-bit integers can represent integers in the range of approximately 2 billion to +2 billion. This fixed-size restriction is rarely troublesome, but there are applications in which we would like to be able to use a much wider range of integers, such as factorial. This is what …

Member Avatar for ithelp
0
367
Member Avatar for tlox

I am trying to write a C++ program that will prompt the user to enter an angle value and calculate its sine,cosine and tangent without using c math library.The angle value denoted x,should be in radian,otherwise the program will convert it into radian before it computes its sin,cos and tan.So …

Member Avatar for ithelp
0
195
Member Avatar for GPXtC02

Just wondering if i can re-read something i just read in? [code] if(in_stream.is_open()) while(i<50 && in_stream.getline(temp, 50) && temp>0) { if(isdigit(temp)) PX1>>temp; else length=strlen(temp); [COLOR="Red"]if(length>1) { string1[]=temp; in_stream.getline(temp, 50) if(isalpha(temp)) string2[]=temp; else } else PX2>>temp;[/COLOR] i++; } in_stream.close();[/code] Hope it doesn't come across as vague but if towards the end …

Member Avatar for GPXtC02
0
797

The End.