49,761 Topics

Member Avatar for
Member Avatar for Phil++

Hey, I'm currently learning about classes and I am wondering how to implement a sub-class into a class. I have a class atm called "Person" but I want to create a sub-class called administrators. So would it be: [code] Class person { public: // class methods // class methods private: …

Member Avatar for dkalita
0
147
Member Avatar for saarah
Member Avatar for ASFtlink

Hello, I need some help on processing only even numbers on a counter-controlled do-while-loop, an event-controlled do-while-loop, and event-controlled do-while-loop to process only even numbers that breaks within the loop. I'm new at C++ so help would be appreciated. Thanks. [CODE] #include <iostream> #include <fstream> #include <string> #include <cstring> #include …

Member Avatar for DemonGal711
0
199
Member Avatar for program900

I need to make a function called “menu” that displays a main menu. This function should return the choice of the user please help!!!

Member Avatar for DemonGal711
-4
94
Member Avatar for Towely

I'm attempting to create a computer program that prints a triangle of digits, as well as a "ruler" that measures the user specified width of the screen, showing the width in digits. The ruler must have a tens row and a ones row. The program reads three integers: a) the …

Member Avatar for Towely
0
243
Member Avatar for tiara

Hello guys.. I am really new to OOP (object-oriented programming) with C++. I am trying to make a simulation window program. I have a bit confused about apply linked-list inside the class. I mean, I am trying use linked-list to do adding item menu. Yes, I make the lists of …

Member Avatar for tiara
0
70
Member Avatar for dylank

Hi, I was hoping someone could help me with a C++ string problem. I currently have my program open up a file, read the contents into a string, and then I am trying to look for certain key characters in the string, like < and </. In short, I am …

Member Avatar for Clinton Portis
0
364
Member Avatar for Ponomous

Hey, I am trying to write a program that will take the grades from an input file and average them and print them to an output file along with the names and grades. I know i am missing something simple (but ive been staring at this for 6 hours). Here …

Member Avatar for Ponomous
0
298
Member Avatar for fuggles

Does anyone know of a good DirectInput tutorial? Every one I've found adds all kinds of extra stuff into it, and all it gives me are lines of code without explaining the well, or showing me how to fit them all together.

0
44
Member Avatar for poopynoob

#include<iostream> using namespace std; int main() { char name; cout<<"Enter your name.\n"; cin >> name; cin.get(); cout<<"Hello, " << name; cin.get(); } this is what I have.. Very simple program but I cannot get it to work, as soon as I enter two or more letters when debugging, the cmd …

Member Avatar for poopynoob
0
151
Member Avatar for new programer

Dear all, There is some errors in the code that I can’t seem to spot. The code is [CODE]# include <iostream> using namespace std; int main () { int N; // Declaring and initializing variables int n=0; int i=0; int fact=1; cout << "Please Enter an Integer" << endl; // …

Member Avatar for Grn Xtrm
0
312
Member Avatar for abhipro

Hi all, I have a library built in C++ targeted for linux platform. The authors suggested that with some minor changes, it can be compiled in windows as well.. This library in turn uses the mathematical library called miracl, which does support VC++ and I was also able to build …

Member Avatar for Agni
0
226
Member Avatar for dylank

Hi, Im new to DaniWeb and C++ and was hoping some of you more experienced tech fellas could help me out with a problem. I want to open a file, then read it by 5 characters at a time by putting it into a [CODE]char[5][/CODE] type of array, then analyze …

Member Avatar for dylank
0
192
Member Avatar for ross42111

> THe program works - its is the last piece of code I am having trouble with. I am supposed the wirte and function (month_conversion) which changes the int month that is represented in the input by (montnNumber and monthNumber1 input that number which represents the month and conver that …

Member Avatar for sfuo
0
100
Member Avatar for Valaraukar

I've attached some .h and .cpp files so that you can view the code I am having trouble with. Basically the following errors are being thrown: Error 2 error C2059: syntax error : '{' c:\users\simon\documents\visual studio 2008\projects\objects\sprite.h 19 objects Error 3 error C2334: unexpected token(s) preceding '{'; skipping apparent function …

Member Avatar for Valaraukar
-1
213
Member Avatar for Galf

Hi all, My first post here -- I've been trying to update some old code that uses C-style casts into the C++ equivalent, and I've stumbled on one cast that I can't figure out how to convert. This isn't the code that was giving me issues, but it reproduces the …

Member Avatar for Galf
0
173
Member Avatar for kustrle

First look at attached picture. As you can see there is few check boxes. I would like when I click Install it run selected components (mostly .exe or .bat file) If I'm sure I need to add some code to event handler of Install button? Now in event handler there …

0
59
Member Avatar for killerqb

I am trying to optimize my hash function, for a separate chaining hash table that I have created from scratch. My hash function is as follows: [CODE] int hash( const string &key, int tableSize) { int hashVal = 0; for(int i = 0; i<key.length(); i++) hashVal = 37*hashVal+key[i]; hashVal %= …

Member Avatar for Rashakil Fol
0
5K
Member Avatar for Xantox

So I would like to know if there's any way to do the following more efficiently: [CODE]while(g[0] = 0 || g[0] = 1 || g[0] = 2 || g[0] = 3 || g[0] = 4 || g[0] = 5 || g[0] = 6 || g[0] = 7 || g[0] = …

Member Avatar for Sky Diploma
0
118
Member Avatar for vhertie

how can i make a program that the computer will allow the usser to input a number.. then it will turn into a word? example: 1030=one thousand thirty

Member Avatar for vhertie
0
146
Member Avatar for colmcy1

Hey all, writing up some code to copy a string from a text file and extract numbers from the string. What I have so far is: [CODE]#include <iostream> #include <fstream> using namespace std; int main(int argc, char *argv[]){ ifstream in("test.txt"); if(!in){ cout << "Cannot open file."; exit (1); } char …

Member Avatar for Ancient Dragon
0
89
Member Avatar for Your_mum

Hi, I am trying to learn C++, and to a certain extent, yeah, it's going alright so far. but I keep getting problems with header files and the like, so I would be really grateful if you guys could help me out. 1) Can't: #include "stdafx.h" - fatal error:file or …

Member Avatar for Your_mum
0
182
Member Avatar for mcap61

OK, so i need help adding my total_points = temp1 + temp2 + temp3, but everytime they just equal 0. This is a student grade class average program, where you enter a student's info, it gets calculated, then you add the next, after entering all studen't you have to figure …

Member Avatar for rdrast
0
113
Member Avatar for Zay

Hello; read this quastion , what do the last part mean ? do they mean to print the remine cookies that have to be produced to let the number be complated ! or to print the number of cookies that we throw ! -------------------------------------- [B][U]the quastion is :[/U][/B] A box …

Member Avatar for Zay
0
100
Member Avatar for th3learner

hello can any one please write code in simple language tht how to find vowel from string Thanks

Member Avatar for mrnutty
0
115
Member Avatar for tatata

[B]i hav a task to make a program,,the program is like this make a video rental system. instead of putting a struct use a importing and provide documentation for the video rentalsystem .Aside from this code provide explanation about this program & how to use it..pls can u help me..[/B]

-2
41
Member Avatar for dumbncool

Hi guys, I'm trying to solve this interview question: "Write a function which, given n, prints all well-ordered integers of n digits. A well ordered number is one where the value of the i-th digit is less than the value of the i+1 digit." I've written the code where if …

Member Avatar for dumbncool
0
642
Member Avatar for kustrle

I would like to automatize for example Java Installer to install Java without any additional user input. When I run Java Installer.exe I see following picture (attached, 100.png) I would like my program (whatever, console or something else - I don't know what) to automatically press Install button and bring …

0
69
Member Avatar for Azmatraz

I'm writing a pennies game in which a player and the computer take coins from a pile until only one remains. The trouble is I keep getting an error saying "warning C4700: uninitialized local variable 'nuCoins' used" though I thought after the user input a value it would be. Any …

Member Avatar for Azmatraz
0
161
Member Avatar for th3learner

[code=c] #include<iostream.h> #include<conio.h> #include<string.h> void main() { char s1[30],d[30]; int l; clrscr(); cout<<"Enter your name: \n"; cin>>s1; cout<<s1<<endl; l=strlen(s1); cout<<l; d=strupr(s1); cout<<d; getch(); } [/code] When i run this code , it shows Lvalue required error please help

Member Avatar for mrnutty
0
91

The End.