49,761 Topics

Member Avatar for
Member Avatar for jorge.carmonajr

I need help with a program i am writing( i am new to programing). I am writing a program to Coordinates have the form (x, y, z) Use double variables to represent the private data of the class. Provide a constructor that enables an object to be initialized when it …

Member Avatar for jorge.carmonajr
0
201
Member Avatar for steadi

Hello There, I am currently making a small game in c++ and Qt. In the game, an npc call's the Wander() function which makes it randomly wander around. However, only one of these npc's can call the Wander() function at any one time - Is there a way around this? …

Member Avatar for Lucaci Andrew
0
353
Member Avatar for seeds

Hello I have this problem where my text file is not read in properly to the linked list. It spits out only zeroes. Here is the code I have written. Thanks. include <iostream> #include <fstream> #include <iomanip> #include <string> using namespace std; struct widget { double R; double S; int …

Member Avatar for NP-complete
0
133
Member Avatar for Rachel Ard

#include <iostream> #include <iomanip> #include <fstream> #include "groupProj.h" using namespace std; const char Avail = '#'; const char Taken = '*'; const int r = 15; const int c = 30; char SEATS[r][c]; int main() { // Declarations for main ifstream inputPrices; double seatPrices[15]; int row; int column; double cost; …

Member Avatar for vmanes
0
190
Member Avatar for PrimePackster

Well Guys! I was learning how to read and write class objects from & to file respectivily. And here is a small code that i made...... As far as the code goes its all well.... And i am getting what i want.... But what i want to know is, **where …

Member Avatar for Ancient Dragon
2
189
Member Avatar for nekoleon64

//Bubble.h #include <iostream> #include <fstream> #include <cstdlib> using namespace std; struct nodeType { int info; nodeType *link; }; class Bubble { public: Bubble(); //constructor //deconstructor //copy constructor //operator= (overloading the = operator) friend istream & operator>> (istream &infile, Bubble & mylist); friend ostream & operator<< (ostream &outfile, const Bubble & …

Member Avatar for VernonDozier
0
1K
Member Avatar for munchlaxxx

As you can see, I'm struggling with classes. How do I call my fraction plus(fraction second), fraction minus(fraction second), etc. functions? #include<iostream> using namespace std; class fraction { private: void reduce() //I will do this later. {} int num, denom; public: fraction() { num = 0; denom = 1; } …

Member Avatar for mike_2000_17
0
214
Member Avatar for James19142

I need a way to do a cast without being returned a pointer to a new address but, the same address as the original. Something like this: derivedClass something_derived; baseClass* basePointer = &something_dervived; derivedClass* derivedPointer = static_cast <derivedClass*> (basePointer); /* my problem is "derivedPointer" isnt assigned the same address as …

Member Avatar for James19142
0
187
Member Avatar for restrictment

Hey everyone, I am taking an online C++ class and part of our assignment is to complete a whole bunch of small program snipits on a site called myprogramminglab.com. This one program seems to have me stumped as I am not very familiar with Data structures. Could someone help me …

Member Avatar for restrictment
0
256
Member Avatar for singlin

I have been asked to write a coding for calculate GPA by using struct and array. I want to display the ouput for every subjects's name, subjects' code, grade for every subject and GPA for every sem but i coulds't get the ouput i want. I think i had done …

Member Avatar for ravenous
0
7K
Member Avatar for Rachel Roxx

#include <iostream> #include <iomanip> #include <fstream using namespace std; const char Avail = '#'; const char Taken = '*'; const int r = 15; const int c = 30; char SEATS[r][c]; int main() { // Declarations for main ifstream inputPrices; double seatPrices[15]; int row; int column; double cost; int answer; …

Member Avatar for mike_2000_17
0
136
Member Avatar for nitin1

i have started using C++ these days. Initially , I have done coding alot in C language. I have seen that on my onliune judges , there are 2 different versions. Why they have given 2 versions to compile the code ? Can you tell ? thanks if you can …

Member Avatar for mike_2000_17
0
448
Member Avatar for matt.sunder.7

Hi, i'd like to ask for some help about a problem i got... So i got this code right now: Code: const int rows = 5; const int cols = 3; int tocke = 0; int tekmovalci[rows][cols]={{7, 6, 9}, {8, 7, 8}, {6, 9, 10}, {7, 7, 9}, {8, 8, …

Member Avatar for Ancient Dragon
0
678
Member Avatar for James19142

in this program i'm writing the functions that have qt classes as parameters Qlabel, QSpinbox, etc. are causing compile errors, my other functions work fine i get the same 2 errors for each QT object i use as an argument this is the function definition that uses QT classes as …

Member Avatar for James19142
0
367
Member Avatar for JaxConer

Hello, guys i have an irritiating problem in the following function: void Sort(Point P, Point &AT50, Point &AO50){ Point AT50_new, AT50_last, AO50_new; while (P != NULL){ if (P->Age <= 50){ AT50_new = new Member; AT50_new = P; AT50_new->next = NULL; // <--from here comes the problem if (AT50 != NULL) …

Member Avatar for JaxConer
0
132
Member Avatar for kaywt

I have the following code that I need to figure out what the output will be. Whenever I try to run it I get an debug error - and it crashes... Somebody else said that it ran fine on their Apple machine. I just need to see what the output …

Member Avatar for kaywt
0
224
Member Avatar for NoUserNameHere

Is it possible to point to a certain index of a value? For example, int x = 2576, is it possible to do something like x[2]? I know you can do it with strings, but can you do it with numbers?

Member Avatar for NoUserNameHere
0
94
Member Avatar for strava

I'm newbie in C++ programming and I want to declare a constructor from following code in my main however I'm completely confused about it. Here is the code: #include <vector> using namespace std; template <typename HashedObj> class HashTable { public: explicit HashTable( const HashedObj & notFound, int size = 101 …

Member Avatar for deceptikon
0
640
Member Avatar for IcyFire

I need to write a program (using Dev-C++) which can count the number of hyperlinks of a given web page. The main objective is to practice socket programming and try to use HTTP protocol. I am not sure exactly how to go about doing this. Can anyone help me figure …

Member Avatar for IcyFire
0
266
Member Avatar for guy21

void main() { char line[300]; cout<<"enter ascii code"; cin>>line; int d = strlen(line); for(int i=0; i<d-1; i+4) { if(line[i]!='.') { (int)line[i]; (int)line[i+1]; (int)line[i+2]; int num=(line[i]-48)*100+(line[i+1]-48)*10+line[i+2]-48; cout>>(char)num; } } getch(); } ok, you enter ascii codes like 104.101.121. and the program converts this into a line like 'hey'. But there's something …

Member Avatar for guy21
0
112
Member Avatar for shark101

hello I have the following program in which there is a switch menu and when a person enters 2 the switch menu should take to the second function which is funcTwo but it is not doind so and just gets back to the menu it self i tried switching the …

Member Avatar for ravenous
0
124
Member Avatar for karan.rks

Hey... I have created a prgoram in turbo c++, and i wanted it to export it as a separate file ... that is out of the bin file.. and out of all the other include file, so that it actually runs on every computer who even does not have a …

Member Avatar for karan.rks
0
179
Member Avatar for Xmod

How can I get this [code](http://www.mediafire.com/?o3kg3nii2sfoigh) to work? I am using xcode 4.5. Thanks

Member Avatar for vijayan121
0
476
Member Avatar for HLA91

Hi all I am a noob to C++ and I was getting some source code off the web and this is the second time it has happened, when I compile (Blood Shed Dev) I get a message in the compiler "permission denied" "Id returned 1 exit status" Can anybody help …

Member Avatar for graceville
0
3K
Member Avatar for James19142

Im having this weird runtime error whenever I attempt to copy a specific member of an array block. I get this from the output: ASSERT failure in QHash: "Iterating beyond end()", file tools/qhash.cpp, line 293 Invalid parameter passed to C runtime function. Invalid parameter passed to C runtime function. I …

Member Avatar for James19142
0
895
Member Avatar for hwoarang69

i know java c and c++ but i like java just because it was the first language i learned. i ask alot of people and they all seem to say "make game in c++" or "not a good idea to make games in java". what you guys think? should i …

0
95
Member Avatar for SeePlusPlus2

Hi, if we take for example 32bits: 1111 1000 0000 1000 0001 1111 1100 0000, how does it become (24bits) 1011 1110 0011 0110 1111 0110 after RLE is applied? Why/how does 1011 represent the 5 1's at the start of the 32bit number? I'm trying to understand the concept …

Member Avatar for SeePlusPlus2
0
181
Member Avatar for PrincessLyka

#include <iostream> #include <cmath> #include <stdio.h> using namespace std; int main () { int n, x=0, ans; int b=0; do { x++; cout << "\nINPUT NUMBER: "; cin >> n; if(b<n) { b=n; } } while (x<=10); cout << "\n"; cout << "\nHIGHEST: " << b; system ("PAUSE"); return 0; …

Member Avatar for deceptikon
0
123
Member Avatar for tayyabatiq

Hi, I want to output [chess symbols](http://en.wikipedia.org/wiki/Chess_symbols_in_Unicode) from unicode to console in c++, please tell me how to do that. Im using Dev c++, windows8 and console. Im just a beginner so please keep it simple for me (also tell me the libraries to include please)

Member Avatar for tayyabatiq
0
4K
Member Avatar for narlapavan

#include<iostream> #include<vector> #include<algorithm> using namespace std; class Cords { public: int x,y,z; }; class Object:public Cords { int a,b,c; public: vector<Cords> vCords; void insertCords(); void getCords(); }; void Object::insertCords() { Cords theCords; int x=1; do { cout<<"Enter X:"<<endl; cin>>x; cout<<"Enter a b c:"<<endl; cin>>a>>b>>c; theCords.x=a; theCords.y=b; theCords.z=c; vCords.push_back(theCords); }while(x!=0); } …

Member Avatar for deceptikon
0
221

The End.