49,766 Topics

Member Avatar for
Member Avatar for Labdabeta

If I have a templated storage class, how can I create a specialized template for nested storage class. I already know how to specialize pointer template, but I don't know how to specialize this. EG: [CODE]template <typename Type> class Array { ///Array class code }; int main() { Array<int> rob; …

Member Avatar for Narue
0
139
Member Avatar for atticusr5

hello all, I am writing a program to test sorting times, and I am having trouble with my quick sort. essentially, my quicksort is not sorting and I am having alot of trouble with it. Does anyone see any real problems with my implementation? Thanks! [CODE] //-------------------------------------------------------- void quicksort(name_t *&charArray, …

Member Avatar for geojia
0
151
Member Avatar for dophine

Hi, I have the following code. and it works fine. [CODE] class base { public: base() {}; virtual ~base() {}; virtual void foo() = 0; virtual void boo() = 0; }; class derive2 : public virtual base { public: derive2() {}; virtual ~derive2() {}; virtual void foo() {}; }; class …

Member Avatar for Fbody
0
184
Member Avatar for sosongetsu

My class did a practice program and worked thru it however i was absent due to illness but i was sent the parameters they used for practice. I attempted it on my own but i was unable to figure it completely but i did get part of it down before …

Member Avatar for WaltP
0
2K
Member Avatar for exca

Hi all, I am writing a program in which there is a part that computes all the possible values for two vectors of string patterns, one like 1XX78X9X32X (11 digit) the other like 26XX (4 digit), using digits from 0 to 9, and that passes all these possible strings to …

Member Avatar for Momerath
0
146
Member Avatar for king03

Hello there guys I have a noob question I just want to ask what is syntax declaration? Is it the program source code itself? help me please I'm a bit confused...

Member Avatar for 200908093
0
158
Member Avatar for sahil1991

hello frndzz... just wrote a piece of code in c++....bt this didnt create any .DAT file as expected.....dun knw wats wrng.... #include<fstream> #include<iostream> using namespace std; class person { int age; char name[40]; public: void get() { cout<<"enter age:"; cin>>age; cout<<"enter name:"; cin>>name; } void show() { cout<<"age is:"<<age<<endl; cout<<"name …

Member Avatar for daviddoria
0
135
Member Avatar for leonziyo

// i dont know why the part below bunny class doesnt work properly help line: 223 i allocated a class array but i can figure out why it doesnt work [CODE=c++] #include "stdafx.h" #include <iostream> #include <ctime> #include <string> int p[100]; // global varialbe int times=0,last=0; void ruleta() { for …

Member Avatar for daviddoria
0
220
Member Avatar for aishu........

can any one help me by giving the complete program on airline[COLOR="Red"] reservation system in c++[/COLOR] language its for my project

Member Avatar for daviddoria
-1
68
Member Avatar for mugenoesis

okay i've got a problem with this code its going to be a apart of a word guessing game, the problem is that my code reads the file i want it too, but when i ttry to guess the letter it will only read the first letter, i know that …

Member Avatar for daviddoria
0
170
Member Avatar for sdr001

Hello, I am having a problem when I am trying to create a new node. The problem is on line: [CODE] tnode->lc= new cttNode; [/CODE] Here is the template the problem resides in: [CODE] template <class B> int ctt<B> :: insertIfNew(const string &key, const B &index) { cttNode<B> *tnode= root; …

Member Avatar for daviddoria
0
161
Member Avatar for ziggystarman

Hi Got a webBrowser control on a form displaying ads from a server, trying to load page in the default browser when user clicks on a banner within webBrowser control, by default the control always load pages within IE Browser which is not really what one wants. This is about …

Member Avatar for ziggystarman
0
698
Member Avatar for geir88

Hi, I've got an assignment at school that I would really like help with. I'm a total newbie. [code=c]#include <iostream> using namespace std; int main() { char chr=(char)67; unsigned int offset = 1000; char * ptr=(char*)0; ptr+=offset; cout << ptr[0] << (char)43 << (char)(chr-24) << endl; } [/code] The questions …

Member Avatar for Fbody
0
110
Member Avatar for honamc

I have a major concern about this. Recenlt i am doing a sequenclick game. in 16 boxes, when start, there are randomly 16 different numbers coming up.

Member Avatar for jonsca
0
103
Member Avatar for BMPaul

Hello, im a noob with C++ at the moment and Im trying to create a BMP image from pixel data stored in a array. Everything seems to work except that when i look at the file generated in a hex editor i get an extra '00 00' in between the …

Member Avatar for gpyrounakis
0
2K
Member Avatar for Gernicha

Hey everyone!! I am having trouble printing the whole of a multidimensional char array. [CODE] #include <iostream> using namespace std; int main(){ char array [5][10] = {"---------", "| |", "| |", "---------"}; cout << array << endl; system ("pause"); return 0; } [/CODE] It just gives me random numbers and …

Member Avatar for Gernicha
0
186
Member Avatar for sheri khan

please any one give me the code of this program using nested for loop * ** *** **** ***** please see attachment for correct question

Member Avatar for csurfer
0
69
Member Avatar for tetran

Hi all, I just want to ask about setprecision because I'm a bit confused. here's the code: [CODE] #include <iostream> #include <iomanip> using namespace std; int main() { double rate = x; cout << fixed << setprecision(2) << rate; }[/CODE] where x = to following: the left side of equation …

Member Avatar for Momerath
0
80
Member Avatar for mrinal.s2008

I was a C++ trainer for 3+ years and now am a developer with a software company. Last week, i had to undergo a C++ test on [url]www.brainbench.com[/url], as a part of my company's internal assessment. I scored 3.5 in the test (I'd gone unprepared at all). Can someone please …

Member Avatar for jwenting
0
111
Member Avatar for salty11

im trying to get this function to show the numbers that are not on the list in the input file, i've written this and it doesnt work, i know theres sometihng wrong with it but im not sure what it is? or how i can fix it to make it …

Member Avatar for salty11
0
179
Member Avatar for mpike

OK! i have a problem. I'm making a game with a character you control and theres monsters that move when you do and when you run into a monster i have it so you lose 1 life. (iLife --; ) i set iLife equal to 4 at the start. if …

Member Avatar for VernonDozier
0
125
Member Avatar for massivefermion

I know the how to fill a magic square but there is a problem in the code. The algorithm is like below: 1-Put number 1 at the second column of first row. 2-Put the next number one upper row and one behind column. 3-If the cell mentioned in the last …

Member Avatar for massivefermion
0
209
Member Avatar for hous3aholik

Hi guys im trying to generate 5 random numbers that return a string so i can compare it to a file. so far i have this but i have no idea how to make it a string. Since i have to compare it to the file i mentioned earlier. This …

Member Avatar for TrustyTony
0
2K
Member Avatar for tdba.316

Hi! For the past few months I've been self-learning C++ with the book "C++ Primer Plus" by Stephen Prata. After having gotten through chapter 7, I decided to check my progress by writing a little program, Baztro. Baztro stands for Basic Astrology Tool. It asks you for birthdate(s) and will …

Member Avatar for tdba.316
0
578
Member Avatar for moey187

Hi, I'm new to programming and I'm doing a course in uni. I'm currently using "Dev-C++". I've been away on holidays and haven't been able to grasp the work we're doing now. I would really appreciate it if any of you C++ programming geniuses helped me with my work as …

Member Avatar for ntrncx
0
559
Member Avatar for jmcginny5

I have to "re-write" the program that I wrote before. Here is the prompt of what to do: Overview For this assignment, re-write program 7 so that rather than using multiple arrays to hold the player information, it uses a single array of structures. The structure that will be used …

Member Avatar for damm
0
399
Member Avatar for DaniwebOS

I'm getting a "IntelliSense no default constructor exists for class "Person" line 71." Also am getting error c2512: 'Person:' no appropriate default constructor available... There is a constructor there which confuses me on why I'm getting an error? [CODE]#include <iostream> #include <string> using namespace std; class Bio { public: Bio(); …

Member Avatar for DaniwebOS
0
21K
Member Avatar for hous3aholik

Hi! Im finishing up a lottery number generator and the only part im kinda lost in is the binary search part. I have two strings = input[], random; I have to go through each subscript and check if it matches my already random generated number. Thanks in advance to those …

Member Avatar for VernonDozier
0
193
Member Avatar for cossay

The program below crashes anytime I run it, can anyone tell what I have done wrong?. [CODE] #include <iostream> #include <cstring> using namespace std; class Human { private: char *fname; char *srname; char *phone; public: char * getFirstName(); char * getLastName(); char * getPhone(); Human(char *fn, char *sn, char *ph); …

Member Avatar for Tomi1988
0
142
Member Avatar for manofhouse

Program is suppose to convert binary to hex.. it says that i need a class/struct/union to the left of ".substr" but im pretty sure convert should be working.. [CODE]#include <iostream> #include <string> using namespace std; int main () { string convert [8]; string bin[16]= {"0000", "0001","0010","0011","0100","0101","0110","0111","1000","1001","1010","1011","1100","1101","1110","1111"}; string hex[16]= { "0","1","2","3","4","5","6","7","8","9","A","B","C","D","E","F"}; …

Member Avatar for Tomi1988
0
419

The End.