49,761 Topics
| |
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: … | |
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 … | |
I need to make a function called “menu” that displays a main menu. This function should return the choice of the user please help!!! | |
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 … | |
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 … | |
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 … | |
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 … | |
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. | |
#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 … | |
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; // … | |
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 … | |
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 … | |
> 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 … | |
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 … | |
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 … | |
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 … | |
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 %= … | |
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] = … | |
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 | |
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 … | |
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 … | |
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 … | |
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 … | |
hello can any one please write code in simple language tht how to find vowel from string Thanks | |
[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] | |
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 … | |
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 … | |
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 … | |
[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 |
The End.