49,761 Topics

Member Avatar for
Member Avatar for Christoph928

In this programming assignment I need to implement a number of useful functions using a header file and an implementation file. I will place the prototypes for my function in a .h file, and implement these functions in a .cpp file. I will also need to write a driver (a …

Member Avatar for Stefano Mtangoo
0
174
Member Avatar for Covert06

Hello, I'm still a huge beginner in C++ and while i spent hours trying to find a solution to this problem i came to this forum pretty often and I thought it'd be a good idea if I try to ask about my problem. (If you notice anything that can …

Member Avatar for Covert06
0
3K
Member Avatar for TheWolverine

Hi all, I am trying to write a general function that when called is able to write the value of all the member variables of an object passed to it. This function is part of a class. The class objects that I want to write out each have a member …

Member Avatar for TheWolverine
0
308
Member Avatar for mertserimer

the inputs are these computer 21 sabanci 4 sabanci 6 university 6 university 12 computer 17 university 3 computer 9 computer 6 sabanci 2 university 9 problem occurs at third line when the input name1 is equal with the previous input name1. Really thx for helping. Sorry for mess. #include …

Member Avatar for mrnutty
0
174
Member Avatar for RobBobSmith

Hi everyone: I am a c++ newbie. I have created a matrix class based on dynamic arrays. My goal is to use it for creating 2D matrices that I can then use to solve heat/fluid transport problems. When instantiated, I need each matrix to be initialized with zeroes only. I …

Member Avatar for Lerner
0
149
Member Avatar for rees90

There was a post about this before: [url]http://www.daniweb.com/forums/thread88472.html[/url] but no code in it, this is the code I have written and it calculates the sine of x, but not exactly what I was asked to do, I have set counter to 15, and there should be no counter, it should …

Member Avatar for VernonDozier
0
181
Member Avatar for sniper6560

[code]#include<iostream>// e^x with factorial function using namespace std; #include<cmath> double factorial(double); int main () { int i=1; double x, a=1, j, y, z, E=0.0000000001;//E is error rate cout<<"enter x to get e^x : "<<endl; cin>> x; y=x; for( ; ; ) { j=factorial(i); z=y/j; if( fabs(z)<E) break; else { a=a+z; …

Member Avatar for VernonDozier
0
98
Member Avatar for PcCopat

Hello, I want to make a linked list program consisting of one main link, and each main links have sub link. [CODE]Main 1 -> Main 2 -> Main 3 -> ... -> Main N -> NULL | | | | Sub 1-1 Sub 2-1 ... ... | | Sub 1-2 …

Member Avatar for kbshibukumar
0
123
Member Avatar for pearle

Hi, all. I'm trying to write a function that checks the status of a Tic Tac Toe game. If there's a winner, it'll return the character for the winner ('X' or 'O'). If there's a draw, it returns 'D'. I'm having trouble getting it to check whether the game is …

Member Avatar for usainbolt
0
4K
Member Avatar for miYn2o0

I have a wireless camera with RGB (RCA) exit cable (PAL) and I was planning to control the video via C++ code The idea was to use something like EasyCap adapter (RCA to USB with a driver CD) to let the camera play video in my notebook but the question …

Member Avatar for miYn2o0
0
258
Member Avatar for designsecrets

Thanks for all useful tips in your useful forum, I am wondering if I can get help to make some changes on this C++ code for finding the least cost path for dijksta algorithm in specific case. I would like to change the output to 2 lists, as follow 1-show …

Member Avatar for Nick Evan
0
156
Member Avatar for tanya9x

Hello everyone, I have to do programming to make a small, straightforward game operating over a LAN network. I think I should use Visual C++ and MFC libraries from Microsoft, because it's easy to learn and use. Dealing with some network programming concepts such as TCP, UDP and some Socket …

Member Avatar for nats01282
0
277
Member Avatar for gulfx01

Write a program that produces a table converting distance in feet to distances in meters, for values of feet from 10 to 200, in steps of 10 feet. There are 39.37 inches in 1 meter, three feet in 1 yard, and 12 inches in 1 foot. You must use a …

Member Avatar for abhimanipal
0
141
Member Avatar for rpowell16

Hey, im new to C++, and im trying to create a class IntList. I am getting errors at compile time with one line, but i have no clue why! Could someone please help, so i know what needs changing or why the errors are occuring. The errors occuring are:- error …

Member Avatar for Banfa
0
88
Member Avatar for manoj_rashmi

hello every one i am new member of this community. Any one see my problem please reply. problem :- How to use object as Function argument. please reply.....

Member Avatar for abhimanipal
0
94
Member Avatar for stewartmatheson

Hello I am new to C++ and I am trying to understand the subject observer pattern. Here is what I have been working on based on an example form the design patters book. [CODE] #include <vector> #include <iostream> class Subject; class Observer { public: virtual void notify(Subject* s) = 0; …

Member Avatar for Banfa
0
171
Member Avatar for Y JIANG

Hi all, I'm reading the book Accelerated C++ and encountered a problem described on P256&P257. Here is the code fragment: [CODE] template <class T> class Handle { public: Handle():p(0){} Handle(const Handle& s):p(0){if (s.p)p = s.p->clone();} Handle& operator=(const Handle&); ~Handle(){delete p;} Handle(T* t):p(t){} operator bool() const {return p;} T& operator*() const; …

0
43
Member Avatar for sandeep.shine

ello all. I am fairly new to progamming. I have a free C++ compiler(DEV-C++) and i was wondering if this is ok or should i actually buy a better C++ builder. I'm postive everyone will probably tell me 1 of 2 things. 1) Stick with DEV-C++ and come back when …

Member Avatar for Ancient Dragon
1
167
Member Avatar for Samuelandjw
Member Avatar for BrandonB

I have created a function to determine the lowest out of 5 scores, I'm not too sure as to whether or not it can be simplified... the function is as follows: [code=C++] void findLowest (int & minScoreP, int score1P, int score2P, int score3P, int score4P, int score5P) { minScoreP = …

Member Avatar for BrandonB
0
120
Member Avatar for bikeha

Hello members, I am a new member here, i would like to draw a parabol graphs: y=x^2 in C++. But i don't know how to write it, anyone can help me?Thank you so much.

Member Avatar for bikeha
0
263
Member Avatar for NeedHelpWithC++

Hi, New to this forum, but been browsing a few threads and seems like the best place to seek help. I have an assignment to complete. What I need to do is read in values from a .txt file and place these values into a matrix. I have the values …

Member Avatar for creative_m
0
197
Member Avatar for lotrsimp12345

When i run main it prints out gibberish not sure why. main.cpp [CODE] #include <iostream> #include <string> #include "phrase.h" #include "EA.h" #include <cstdlib> #include <time.h> int main() { phrase a; EA b; std::string phrase; int populationsize; std::cout<<"enter a population size\n"; std::cin>>populationsize; std::cin.ignore(); b.setpopulationsize(populationsize); std::cout<<"enter a string\n"; getline(std::cin,phrase); a.setphraselength(phrase); b.setlength(phrase); std::cout<<"the …

Member Avatar for lotrsimp12345
0
83
Member Avatar for aianne

Hi! I need help to my c++ program. I created a program that is much like the "Who wants to be a Millionaire" television show. It has questions and the right answers and three lifelines. How can I possibly do eliminate a lifeline after being used.? this is the program …

Member Avatar for aianne
-1
162
Member Avatar for pearle

Another recursive problem. I'm trying to write a function that reverses an int value recursively. I think I've got the algorithm right, but I can't get the base case right. So my program ends up printing 5 infinitely... Here's the code: [CODE]#include <iostream> #include <cmath> using namespace std; void reverseDisplay(int …

Member Avatar for WaltP
0
156
Member Avatar for lotrsimp12345

I am trying to create a double pointer. never done it before. Problem is currently in intializepopulation(); Error C2106 left of operand must be l-value. EA.h [CODE] #ifndef EA_H_INCLUDED #define EA_H_INCLUDED #include <string> #include "phrase.h" #include <iostream> class EA:public phrase { public: EA(); ~EA(); void setgenerationnumber(int generationnumber); int getgenerationnumber(); void …

Member Avatar for lotrsimp12345
0
109
Member Avatar for winecoding

just starting to learn C++, and sort of confusing about the following section of code: [CODE]int *getCharCountArray(char *str) { int *count = (int *)calloc(sizeof(int), NO_OF_CHARS); int i; for (i = 0; *(str+i); i++) count[*(str+i)]++; return count; }[/CODE] In specific, do not quite understand how the following two work? [CODE] for …

Member Avatar for mrnutty
0
94
Member Avatar for techie929

Hi, I need to read 4 bytes from file to form a 32-bit unsigned integer X. The first byte you read goes into the most-significant byte of X, the 2nd byte you read goes into the 2nd most-significant byte of X, the 3rd byte you read goes into the 3rd …

Member Avatar for WaltP
0
2K
Member Avatar for limengfang77

Need help on this array problem, thebolded part is what I'm really confused, How can I check if the user entered a negative value? and How can I return the [B]count [/B]to the previous cout? thanks 2. Write a function to read in numbers and put them into the array. …

Member Avatar for WaltP
0
148
Member Avatar for mks200

hi, this is the problem, i wrote what i could but i dont know what im doing wrong 1. Write a function to read in numbers and put them into the array. The function should continue to read in numbers until either: the user types a negative number, or 5 …

Member Avatar for WaltP
0
250

The End.