49,757 Topics

Member Avatar for
Member Avatar for olams

hi, i wrote this program on polynomials and how to manipulate them. however, i am having a problem with my eval function. it is supposed to evaluate the polynomial at a particular number. however, whenever i call a.eval(2.0), i keep getting polynomial a. please help me look into this. [code] …

Member Avatar for olams
0
149
Member Avatar for kako13

Hi, I'm getting this error: Asig 2.cpp In function `void ManiMatrix()': 31 Asig 2.cpp expected primary-expression before "int" Asig 2\Makefile.win [Build Error] ["Asig 2.o"] Error 1 Here is how I'm calling it from main: customMatrix.checkIfMagic(); Prototype in the class: void checkIfMagic(int**); void matrix::checkIfMagic(int **arrayOfArray) {// function began } // function …

Member Avatar for kako13
0
151
Member Avatar for Gopala Krishnan

when i use a dynamic 2d char array using pointers, i dont get any errors but the program is not executed correctly... //Pro to enter and display strings using dynamic 2d char array. [code=c] #include<iostream.h> #include<conio.h> void main() { char **v; int s; cout<<"Enter size :: "; cin>>s; v=new char[s]; …

Member Avatar for VernonDozier
0
99
Member Avatar for atish00

Can anyone help me wiht the prog. arrange a 1D array in ascending order. No need for the prog. code just explain me the logic.

Member Avatar for Lerner
0
140
Member Avatar for noellieb

Hi all, i am trying to do a quadratic hashing but i am having some difficulties probably because i am not in the right logic.using this code: [CODE] #include <iostream> using namespace std; int find(int); void insert(int); const unsigned int size = 13; int load = 0; // number of …

Member Avatar for Narue
0
816
Member Avatar for sanzle

i am trying to pair a vector and an integer but [code] map<vector[i][j],int>m; m.insert(pair<vector[i][j],int>,(v[1][0],sum)); [/code] did not work??

Member Avatar for HackWizz
0
56
Member Avatar for nurulshidanoni

I want to do two-dimensional array.. STUDENT1 take 001, 003, 005,006 STUDENT2 take 005, 007, 009, 001 001 002 003 004 like this 001 0 2 1 .... 002 003 004 and I do a programming like below, but how to fill inside the { }? [code=c++] // -------------------------------------------------------------- // …

Member Avatar for Ancient Dragon
0
117
Member Avatar for narendra_jntu

Hi all Recently i started using dev-C++ 4. I dont know to work with dev-c++. Plz tell me how create c++ programs and running them. I am trying to explore the dev-c++ ide , but no use. so plz somebody tell me how to work with dev-c++. (If possible tell …

Member Avatar for Ancient Dragon
0
76
Member Avatar for LoloftheRings

Hi, I created an object to create buttons in console applications. But somehow, the program doesn't do much when it's checking if the button is clicked. I got this code from the internet, I could give the original code if you want to study it. I have stripped it down …

Member Avatar for LoloftheRings
0
517
Member Avatar for VersEtreOuNe

[B][COLOR="Red"]Value.h[/COLOR][/B] [code=c++] #ifndef VALUE_H #define VALUE_H #include <iostream> template<typename DataType> class Value { public: Value(DataType val); Value(const Value<DataType>& aValue); Value& operator =(const Value& aValue); Value& operator +(const Value& aValue); void SetValue(DataType val) { _value = val; } DataType GetValue() const { return _value; } template<typename DataType> friend std::ostream& operator <<(std::ostream& …

Member Avatar for VersEtreOuNe
0
111
Member Avatar for TheBeast32

Hi, i have been making a server for a client I made to connect to. I don't have a static IP, so I need a way for someone on another computer to connect to me without me telling the user what it is every time. I have tried to just …

Member Avatar for TheBeast32
0
95
Member Avatar for guitarrick

Desperately need help on how to proceed with the following project: Design and implement and ADT that represents a calendar date. Month, day, and year . Type int is o.k. e.g. 03/08/2008. Include operations that advance date by one day and display the date by using either numbers or words …

0
66
Member Avatar for sjcomp

Hello, I have a vector of callbacks and I'd like to execute them. This is what I do: [CODE=C++] typedef boost::function<void (void)> FCallBack; std::vector<FCallBack> c; // Execute every callback std::for_each(c.begin(), c.end(), boost::bind(&FCallBack::operator(), _1)); [/CODE] This works, but is there an easier way to do so? For some reason reference to …

Member Avatar for vijayan121
0
105
Member Avatar for blcase

i am trying to overload subtraction between two separate classes. Class Id is basically several strings such as the information of a voter database. Class Collect would be the collection of several class Id's in an array along with a total of Class Id's and the title of the collection …

Member Avatar for John A
0
143
Member Avatar for charles_wt

I have borland C++ compiler on my system.while generating random numbers in C++,though i have incuded #include<cstdlib> and #include<iostream> i get these errors 1.cannot open include file cstdlib 2.call to undefined function rand please help me with a solution

Member Avatar for WaltP
0
312
Member Avatar for Darth Vader

Hello everyone. I have attached a folderBrowserDialog1 to my Form1. To a button I will do a function. What I will do now is when I press the button, I want to open this folderBrowserDialog wich works fine. After this I will click on a folder wich contains *.txt Files …

Member Avatar for Darth Vader
0
233
Member Avatar for VersEtreOuNe

Hi. Need to know what's the difference when using Templates between: [inlinecode]template<class T>[/inlinecode] and [inlinecode]template<typedef T>[/inlinecode]

Member Avatar for VersEtreOuNe
0
247
Member Avatar for sgw

Hi, I'm trying to use the pow function. Extremely simple program like the following, but it never passed compiler: #include <iostream> #include <cmath> int main() { int a, b, c; a=2; b=3; [COLOR="Red"]c=pow(a, b);[/COLOR] cout << c; return 0; } Compiler would highlight the red part. What's wrong?:icon_rolleyes: Thanks in …

Member Avatar for sgw
0
638
Member Avatar for kartouss

[code=c++] // Input the plaintext in the array char d; string temp; ifstream myfile1 ("Plaintext.txt"); if (myfile1.is_open()) { do { for ( j=0; j<BC; j++) // BC=4 for ( i=0; i < 4; i++) { myfile1.get(d); a[i][j] = d; // plaintext } Encrypt(a, rk); /* strcpy(temp,a); // Code to write …

Member Avatar for kartouss
0
151
Member Avatar for abhi_elementx

Hi, I am using dev c++ 4.9.9.2 and I am new to DLLs. I am tryig to create a DLL which I am not creating thru the "DLL project" in dev cpp. Here are my three files: //dlltest.h [CODE] #ifndef _DLLTEST_H #define _DLLTEST_H #ifdef BUILD_DLL #define EXPORT _declspec(dllexport) #else #define …

Member Avatar for Duoas
0
164
Member Avatar for LoloftheRings

Hi, I've made a console Pong game. I've added some sounds but the sounds are about 10 external .wav sounds. It seems a bit like a mess when I send the game to somebody, and it's not really user friendly. I want these sounds to be included IN the .exe …

Member Avatar for Duoas
0
251
Member Avatar for Undertech

(Note: sizeof(character) == 68 bytes) I am having issues with fstream::seekg()/seekp(). It seems like when one is invoked to modify the get or put pointer, the other pointer follows it instead of staying in place. Example: [CODE=cplusplus] charfile.seekp(0,ios::beg); cout << endl << "Put pointer is at " << charfile.tellp() << …

Member Avatar for vijayan121
0
194
Member Avatar for sadaka

Hello all. I just recently started a project using directx for a paint program. I am new to directx programming and have not before program with it. The codes that I entered are the typical codes but with modifications to handle directx programming. They compile and link with out error …

0
42
Member Avatar for arby11886

I need some guidance on an assignment I'm working on for school. The objectives of this assignment are to read data from a binary file, use some basic class functionality, store objects in an array and produce a neatly formatting report. [code] #include <fstream> #include <iostream> #include <cstring> using std::ifstream; …

Member Avatar for WaltP
0
93
Member Avatar for jrkeller27

I am writing a simple program that reads in a plain text file (ignoring numbers/symbols) and stores each unique word and the frequency it appears in the text file. This information is stored in a multimap<string, int>. I want to sort the elements in the multimap so as to facilitate …

Member Avatar for vijayan121
1
115
Member Avatar for sjcomp

Hello, I have base class and a derived class if I want to use bost::bind in an algorithm to call a virtual function that is declared in the base class I have two options: [CODE=C++] struct Base { virtual void Go(){}}; struct Derived:Base { virtual void Go(){}}; Derived d; // …

Member Avatar for vijayan121
0
110
Member Avatar for TSharma

I am trying to use sort defined in algorithm in c++. I want to use it in vector string ( vector<string> vec) can we use it i vector string. here is my code [code=c++] #include<iostream> #include<string> #include<vector> #include<algorithm> using namespace std; int main() { vector<string> vec; vector<string> ::iterator it; string …

Member Avatar for TSharma
0
86
Member Avatar for arby11886

I need some guidance on an assignment I'm working on for school. The objectives of this assignment are to read data from a binary file, use some basic class functionality, store objects in an array and produce a neatly formatting report. [code] #include <fstream> #include <iostream> #include <cstring> using std::ifstream; …

Member Avatar for WaltP
0
112
Member Avatar for kenank

Can somebody explain to me "nested class templates" or give me some links about it and some codes ? I get this theme for a homework ! (nasty profesor)

Member Avatar for Jx_Man
0
56
Member Avatar for olams

Hi, please help me with this program that i am writing. i am writing a program to create a polynomial. i set the values, but whenever, i debug it, i get this: 4x^2 + 0X^1 + 0x^0 + which do not correspond to the values that i set it to. …

Member Avatar for WolfPack
0
193

The End.