49,757 Topics

Member Avatar for
Member Avatar for sonicstage

I have this algorithm from my c++ class that i can't get to work, it doesn't compile (mainly because is wrong) and I have no idea on how to fix it. It supposed to be a global function that takes an array of 10 and gives 10 random numbers from …

Member Avatar for Freaky_Chris
0
101
Member Avatar for moshe5

I am supposed to implement an ADT polynomial, using an array for polynomial coefficients- using- degree() - gives the highest degree in the polynomial. coefficient(power)throw(InvalidPowerException) changeCoefficient(newCoefficient, power)throw(InvalidPowerException) overloaded + operator to add 2 polynomials overloaded << operator I cannot use a list class for this project. special cout cases: +1, …

Member Avatar for ithelp
0
104
Member Avatar for kinsey

Hi, I need some help with a C++ assignment. I'm supposed to write a Hangman program that will: The user should be able to choose between playing against the computer, or against another human. The only difference will be how the word to be guessed is selected: If playing against …

Member Avatar for vivekc++
0
842
Member Avatar for DemonGal711

I'm writing the class for the N-ary tree and I need to finish it with a destructor. For my tree, all I do is insert, traverse, print, and destruct it basically. The part of the code dealing with it will be something like: [code]while (/*not at end of input*/) { …

Member Avatar for DemonGal711
0
300
Member Avatar for azwraith69

hello,,:) i have problem doing a FOR loop in my linked list,, it doesn't start the loop,, i don't know why... [icode]class node { public: node(int number, node*nxt):number(number),nxt(nxt){} int getNumber(){return number;} void setNumber(int number){this->number=number;} node* getNxt(){return nxt;} void setNxt(node *){this->nxt=nxt;} private: int number; node *nxt; }; bool mergeList(node *&result, node …

Member Avatar for kbshibukumar
0
144
Member Avatar for redhotspike

Ok, so I am befuddled. Each individual file compile fine, no errors. When I compile all together and create an executable, no errors. But, when I run the program, I am getting an error. I have it narrowed down to a problem with my [icode]void LinkedList::insert(const ElementType &dataValue)[/icode] but I …

Member Avatar for redhotspike
0
180
Member Avatar for daviddoria

I have tried to make a SumVector function for all types, but if it is called with a vector of unsigned char's, it will do something special. Here is what I tried, but I get a multiple definitions of the function compiler error. [code] template <typename T> void SumVector(vector<T> &V) …

Member Avatar for nucleon
0
3K
Member Avatar for monkey_king

I'm having troubles linking together different classes that uses the same templated class. I found 2 workarounds, that will make it compile, but it's not really a solution. 1. don't do a staged compiling with linking object code 2. inlining the spezialized member functions. I'm looking for a solution that …

Member Avatar for StuXYZ
0
832
Member Avatar for moshe12007
Member Avatar for Bladtman242

Is there a simple way to run another program, say IE, FF or just a simple .bat file sith c++? ive searched around a bit but all ive found is rocket science and didn't seem to be what im looking for. i dont wish to run it "trough" my program, …

Member Avatar for Bladtman242
0
1K
Member Avatar for mmeyer49

My code is supposed to accept into for book data and sort it. My problem is when i enter Data it doesnt return to the menu. i know atm it is // but it seems to fail after i enter the data. Also i'm having problem trying to add the …

Member Avatar for r.stiltskin
0
185
Member Avatar for Mossiah

[code=cplusplus] #include "stdafx.h" #include <iostream> #include <iomanip> #include <string> using namespace std; char your_string[256]; char new_string[256]; void ReverseString(); int main() { char choice; do { cout <<"Enter the string that you want to reverse: \n"; cin.getline(your_string, 256); ReverseString(); cout << new_string << "\n"; cout <<"Do you want to continue? Press …

Member Avatar for vmanes
0
109
Member Avatar for cipher

Iam trying to call a C# DotNet 2003 webservice from Visual C++ 6 app (used win32 console, mfc, atl_mfc dll) using Soap toolkit 3. The webservice takes a String input parameter and returns a String. The input parameter I pass through C++ is always recieved as NULL in C# webservice …

Member Avatar for yogesh.chhabra
0
335
Member Avatar for jibber87

Hi there, I'm trying to write a program that calculates the probability distribution for different initial conditions of a population model. The probability is calculated over a for loop over the parameter 'q' (which can be considered as a scaled version of the correcting "struggle for life" term in the …

Member Avatar for jibber87
0
152
Member Avatar for jeevsmyd

Hi... Do you remember me? Am the amateur programmer who disturbs you with my never ending doubts.. :D As you guys advised I have decided to start learning c++ from scratch..! ;)As far as am concerned Files in c++ is the most difficult part in c++ in my syllabus ..! …

Member Avatar for Narue
0
167
Member Avatar for krispygrimace

First, I apologize for any concept errors about C++. I am pretty new. I am having trouble iterating through each node of a passed linked list. What I have right now is an implementation file with a few functions. The class is called listClass and has a private member function …

Member Avatar for jencas
0
172
Member Avatar for crewxp

I have a small problem. I'm curious to see why this happens. If you run this code and enter the data, I put in a debug line. Inside the 'if (grade2>grade) block, the DEBUG printf's don't show the data correctly. Outside the if block, I print pretty much the same …

Member Avatar for crewxp
0
143
Member Avatar for pavani-murali

Hi Every one, Can you please send me what is summit APi and how it is useful along with C+? Regards, Pavani

Member Avatar for ithelp
0
30
Member Avatar for Mossiah

[code=cplusplus] // New2.cpp : Defines the entry point for the console application. // #include "stdafx.h" #include <iostream> #include <iomanip> #include <string> using namespace std; void reverse(string& s); int _tmain(int argc, _TCHAR* argv[]) { string st="Word" ; cout<<st<<"\n"; reverse(st); cout<<st<<"\n"; return 0; } void reverse(string& st) { int i; int j …

Member Avatar for iamthwee
0
154
Member Avatar for mvmalderen

Hello, My problem is that the program always gives the same output: [CODE]There were no matching numbers !!![/CODE] The source of my program looks as follows: [CODE=cplusplus] #include <iostream> using namespace std; int main(void) { const int MAX_CHARS = 500; const int MAX_NUMS = 5; const int MAX_NUM_CHARS = 25; …

Member Avatar for mvmalderen
0
133
Member Avatar for sunderthomas

hey guys i want to slpit a sentence into words but the pogram i have written gives only the first word...can u help me plz..... [code] #include<iostream.h> #include<conio.h> #include<string.h> #include<dos.h> #include<stdio.h> void main() { clrscr(); char text[100]; int i=0; clrscr(); cout<<"enter the sentence"; cin.getline(text,100); while(i<strlen(text)) { char text1[]=" "; int …

Member Avatar for monkey_king
0
161
Member Avatar for Crul

I'm trying to compile C and C++ files into a single executable using gcc. I've gotten my code to compile and run properly using borland and Visual Studio but I can't figure out how to get it to compile with gcc. This is what I've been trying: gcc -c dtio.h …

Member Avatar for Salem
0
1K
Member Avatar for vishy_85

im new to c++. im trying to create a function to get the systemtime every 1 minute and store it in a variable. im able to display the time using the time.h file. the problem is i dont know how to call the function every 1 minute and assign it …

Member Avatar for siddhant3s
0
82
Member Avatar for tpetsovi

The last funtion IsPrimeNumber () is giving me an error that states ..."Local Function definitions are illegal"....can someone please tell me why? Thanks [CODE] /****************************************************************** Name : Date : Homework # : Homework #6 Problem #1 Source : Action : Menu is displayed allows user to calculate Miles per Gallon, …

Member Avatar for kbshibukumar
0
181
Member Avatar for vkarthik

Consider this situation: [code=c++] class Sample { std::string str; public: Sample(string &s) { // line 1 // line 2 str = s; // line 4 throw exception; } ~Sample() { } } [/code] So I have a string member variable, and I have assigned it to the parameter passed to …

Member Avatar for vkarthik
0
156
Member Avatar for TheBeast32

Hi, I'm reading the header from bitmaps. When I add up everything in a struct I've made, it comes out to 54 bytes. When I do a sizeof(BHeader), it says it's 56 bytes. It adds two null bytes after the B and the M when I save a header to …

Member Avatar for TheBeast32
0
100
Member Avatar for Mossiah

[ICODE] #include "stdafx.h" #include <iostream> #include <iomanip> #include <string> using namespace std; char your_string[256]; char new_string[256]; void ReverseString(); int main() { cin.getline(your_string, 256); ReverseString(); cout << new_string << "\n"; return 0; } void ReverseString() { int x = strlen(your_string)-1; for(int y = x; y >= 0; y--) { new_string[x-y] = …

Member Avatar for William Hemsworth
0
71
Member Avatar for Mossiah

[ICODE] #include "stdafx.h" #include <iostream> #include <iomanip> #include <string> using namespace std; // prototype declarations void concatString(char szTarget[], char szSource[]); int main (int nArg, char* pszArgs[]) { //read the first string char szString1[256]; cout << "Enter string #1: "; cin.getline(szString1, 128); //now get the second string char szString2[128]; cout << …

Member Avatar for siddhant3s
0
81
Member Avatar for eck3ko

Hi everybody i really need your help, this is my problem: I have a c++ dll that use MFC, i need to use it in a c# project I need to end with another dll that to use it in the c# project I just cant find solution all over …

Member Avatar for eck3ko
0
170
Member Avatar for MrPickle

I want to store several structs in a vector, but the struct has a template so I get a compile error, how can I store the structs in the vector? Example: [code]template<class First, class Second> struct foo { First f; Second s; }; std::vector<foo> bar; //error! [/code]

Member Avatar for StuXYZ
0
96

The End.