49,757 Topics

Member Avatar for
Member Avatar for Peyton

Hi there, Say I have the following while loop, that loops on the condition that a lne (a string) is received from a file: [CODE]while ( getline( inData2, line ) ) // Increment rows till none left { if ( !line ) { cout << "No data entered. Please enter …

Member Avatar for William Hemsworth
0
147
Member Avatar for hurbano

i have written my code and feel exhausted. when my code finds in error on a given input text file, it does a great job in finding the mismatched symbols. what can i add to show there is no error when no error is found. i attempted adding another else …

Member Avatar for ArkM
0
85
Member Avatar for songweaver

Hey Guys, I am new to the concept of Arrays and I need a little help. I have included the instructions for the problem as well as the code that I have so far. Can you help me with what I am doing wrong? Thanks! Write a program that asks …

Member Avatar for siddhant3s
0
133
Member Avatar for cppStudent

Hi guys, I'm getting " SingletonMain.C:18: undefined reference to `Singleton<MyClass>::instance()' " compiling error. It doesn't make sense to me because MyClass inherits instance() from Singleton, doesn't it ? If someone could shed some light on it, I will be grateful. SingletonMain.C #include <iostream> #include "Singleton.h" using namespace std; [CODE]class MyClass …

Member Avatar for siddhant3s
0
134
Member Avatar for cbreeze

Hello I need to create an array of pointers for class dog is one class and showDog is the derived class. I need to input from a data file and store the variables to these classes. In the file there is a D for dog or S for showDog between …

Member Avatar for siddhant3s
0
94
Member Avatar for slim2hott

Hello everyone, as you can see I am new to this forum, I have had, not huge experience, but a bit of experience with c++. So I decidedt to make a keylogger. I know there are other ways to make this code shorter but for now i would like to …

Member Avatar for NathanOliver
-2
668
Member Avatar for losh177

Hi, i'm having some problems with my inheritance homework. It consists on writing a progrma that mimics the String lib by overloading different operands and then create two derive classes that will revert a string and that will change the cases to lower and upper. This is as far as …

Member Avatar for losh177
0
267
Member Avatar for kkbronner

/* Write a program the nested for loops that display the output below. 0 0 1 0 1 2 0 1 2 3 0 1 2 3 4 0 1 2 3 4 5 */ [code=cplusplus] #include <iostream> #include <cmath> #include <cstdlib> #include <iomanip> using namespace std; int main () …

Member Avatar for NathanOliver
0
151
Member Avatar for BlackStar

Hello everyone I'm having a little difficulty, hopefully you guys can help or point me to the right direction. I'm trying to get a pointer from a class point to another pointer from another class. Naturally it doesn't work because the assignment operator doesn't allow us to do this so …

Member Avatar for BlackStar
0
240
Member Avatar for tksrules

Hi, I have completed a C++ application.It is about 3.5 mb in size. I need to create a demo version of this application,The application should not work after 30 days of installing and using it.. Is there something any software that allows you to create demo versions or what steps …

Member Avatar for Lerner
0
87
Member Avatar for SLORE

Okay, here's the challenge, I know its probably pretty easy, but i'm just starting to learn and I have the challenge problem that I can't figure out, any help/guidance would be appreciated! This program will accept two numbers from the user and display the sum of the square roots of …

Member Avatar for SLORE
0
103
Member Avatar for Sky Diploma

I am getting a segmentation fault when i run the follwing program. This program takes in a const char* and returns the integer format. I also need advice on converting a C++ Octal or Hexadecimal Notationed string to an integer. Here is the code [CODE=C++] #include <iostream> #include <cstring> int …

Member Avatar for mvmalderen
0
222
Member Avatar for Joukon

Hey all. First time user here :) Im making a Windows XP C++ console application with Code Blocks (GNU GCC Compiler). This program is written to control another program that is missing some features i need (read input from external source). Last thing im missing from my program is little …

Member Avatar for Ancient Dragon
0
361
Member Avatar for RayvenHawk

I'm writing a simple number generator program and I'm trying to find an easier way to get a random number, store it then display it. The catch is I don't want duplicated numbers (each need to be different). here is what I have so far, it does work but I'll …

Member Avatar for RayvenHawk
0
164
Member Avatar for Peyton

Hi, I am having a problem with the following function: [CODE]void calcEnergy( vector< vector<double> > &Energy, vector< vector<double> > &Data, const double Constant ) { double Time = 6; // store the change in time double energy ; // Temp variable to store energy double v1,v2; for ( size_t i …

Member Avatar for ArkM
0
107
Member Avatar for pdunc88

Hi there, I have an array of strings defined in the following way; [code] string wordbank[]={"yes", "no", "hello", "goodbye"}; [/code] My problem is I would like to create a seperate array of characters for each element of that array. Something of the form; char *word_0[]={'y','e','s'} The things I have tried …

Member Avatar for pdunc88
0
86
Member Avatar for guest7

Hi, I wish to know that the cause of the following error when i run the program : a) Is memory leak in the program B) The system on which i am running the program has insufficient memory. [ICODE] terminate called after throwing an instance of 'St9bad_alloc' what(): St9bad_alloc[/ICODE] Thanks

Member Avatar for drjay1627
0
112
Member Avatar for Boudou

In the following program, implement the function a. int *biggest(int *a, int count); This finds the largest element in an array of integers. #include <stdio.h> #define SIZE 16 int* biggest(int *a, int count); int main(void) { int values[16] = { 47, 17, 38, 91, 33, 24, 99, 35, 42, 10, …

Member Avatar for khusroo
0
134
Member Avatar for Reprise

I tried searching the forum, but I couldn't find any threads that really dealt with what I'm trying to do here. I have a struct set up with three fields (shown below). [code] struct StudentInfo { char id[10]; double mark; char grade; }; [/code] [I]Note that the id MUST be …

Member Avatar for Reprise
0
1K
Member Avatar for sravan1992

can someone teach me from the basics how to use and become comfortable with graphics.h???plz i need it badly for my project at school and out of my interestto complete my project within august.im unable to continue without graphics.h and dos.h

Member Avatar for iamthwee
0
53
Member Avatar for zaratul

This is my first year of BIT and im doing C++ for first year atm. Now i have this assignment which is i have to generate random number, and prompt the user to quess the number. when they quest it right i have to prompt that they are right and …

Member Avatar for WaltP
0
62
Member Avatar for Lexter25

Can you tell me how to resolve my problem. i can reserve the matrix A and B into file, but how to read , i can't remember...above, shows what i pretend to do.. # include <iostream> # include <fstream> using namespace std; int main() { int matriz[3][3]; int x,i,j;//variables for …

Member Avatar for WaltP
0
286
Member Avatar for rishabjain

Write a program to implement a survey that prompts respondents to enter an integral value within a specified range to indicate how they like a new product. Since the program must be adaptable to any arbitrary number of respondents and value ranges, define macro MAX_RESPONDENTS to represent the maximum number …

Member Avatar for VernonDozier
-2
291
Member Avatar for bmcutler011

[code]#include<iostream> #include<fstream> #include"d_nodel.h" using namespace std; void merge(dnode<double> *, dnode<double> *); //free function to merge the two lists int main() { dnode<double> *listA = new dnode<double>; dnode<double> *listB = new dnode<double>; double sz1, sz2; int val1; //first set of integers int val2; //second set of integers ifstream inFile; //declares the …

Member Avatar for nmaillet
0
241
Member Avatar for power_computer

Ive used the search function just found one thing I needed more detailed help I need to a read file of float numbers no more than 100 numbers but can be less than 100 into an array I have made sample file contain 1 2 3 I have the following …

Member Avatar for power_computer
0
97
Member Avatar for ElWape

If I have a class that has a vector as a private member, a get function to access the vector, and I iterator over the vector, the iteration only works correctly if I make a new copy of the vector: [code] class MyClass { public: typedef vector<int> Vector; MyClass(); ~MyClass() …

Member Avatar for Ancient Dragon
0
142
Member Avatar for scuzzo

I have everything almost done, the only problem I have is that I can't seem to get the linked list to advance when the terms start out with different exponents and instead of just printing the results I will tie them into a third list. Can you see what I'm …

Member Avatar for NathanOliver
0
105
Member Avatar for nokiolurv

can someone help me complete this code please, on the ares i put comments please. thanks #include <stdio.h> #include <string.h> class wordRecord { public: char* word; wordRecord* next; void printWord() { printf("%s\n", word); }; }; class abstractWordList { private: void printWordsHelper(wordRecord* wordRecPtr) { if (wordRecPtr) { // Code omitted to …

Member Avatar for Sky Diploma
-1
120
Member Avatar for vksmaini

Write a program to implement a survey that prompts respondents to enter an integral value within a specified range to indicate how they like a new product. Since the program must be adaptable to any arbitrary number of respondents and value ranges, define macro MAX_RESPONDENTS to represent the maximum number …

Member Avatar for rishabjain
0
314
Member Avatar for andyT

Hello, I'm trying to get the STL equal_range function to work on a data structure I've designed, but I may be trying to use the equal_range function in a non-standard way. Is there a way to get this to work? Basically, I have a vector of vectors of structures (elements) …

Member Avatar for andyT
0
185

The End.