49,761 Topics

Member Avatar for
Member Avatar for samsons17

Hi.. I am trying doing this exercise.Which is require a program that could ask the user how many integer he/she want to enter,and allow him/her entering them thus lastly display them all back. i could just simply doing it by using an array,but this time i wanna use a vector …

Member Avatar for Narue
0
122
Member Avatar for stereomatching

I am using the library of boost to create a 2D dimensions array and compare about their speed There are three kinds of array, matrix of boost, multi_array of boost and the raw array Below is my code: [code] #ifndef TESTRELMAT_H #define TESTRELMAT_H #define BOOST_NO_EXCEPTIONS #define BOOST_DISABLE_ASSERTS #include <boost/numeric/ublas/matrix.hpp> #include …

Member Avatar for Narue
0
140
Member Avatar for Varnius

I started learning Winsock (2.2) programming in university recently and when writing my first program (fileserver and its client) a few questions came to mind. Let`s assume my fileserver is continuously listening for client connections and when one occurs it establishes connection, does whatever client wants (such things as list …

0
119
Member Avatar for moonL!ght

hi every one im working with some exersies which include inheretence every thing is fine except that the compiler dose not recognize the base clase it says Error [COLOR="Red"] Cannot open include file: 'pointType.h': No such file or directory[/COLOR] here is part of the code [CODE] # include "pointType.h" # …

Member Avatar for chiwawa10
0
129
Member Avatar for bbman

alright, I'm a bit stuck here, I've tried a few things but I can't figure it out. Question is in the source: [code=c++] // test.h namespace test { class foo { static void test(); }; } [/code] [code=c++] // test.cpp #include "test.h" namespace test { // how can I define …

Member Avatar for bbman
0
132
Member Avatar for XMasterrrr

like the thread title said i need the best C book for never programmed person can you please tell me it thanks....

Member Avatar for elsiekins
0
170
Member Avatar for Christ1m

The book Im using. Pg 108 - 124 Objects Abstraction, Data Structures and Design using C++ Author: Elliot Koffman and Paul Wolfgang I have a problem with this code. All of these errors are occurring in the Phone_Directory.cpp. It is in, getline, << , out. .......functions... I tried getting these …

Member Avatar for Intrade
0
211
Member Avatar for DonutsnCode

Hi friends, I'm learning to program in C++. I'm using Notepad++ to author my code and Cygwin g++ to compile it. [QUOTE]main.cpp : in function 'int main() : main.cpp : 38 : error: no match for 'operator << ' then a lot of jibberish and number of errors : 1 …

Member Avatar for DonutsnCode
0
137
Member Avatar for itpipx

#include<iostream.h> class Exforsys(); { private: int a; public: Exforsys() {} Exforsys(int w) { a=w; } Exforsys(Exforsys& e) { a=e.a; cout<<"Example of Copy Constructor"; } void result() { cout<<a; } void main() { Exforsys e1(50); Exforsys e3(e1); cout<<"\ne3="; e3.result(); } }

Member Avatar for itpipx
-1
134
Member Avatar for ashtonpearson

// Ashton Pearson, 558771747 // // This program reads an integer and determines whether // or not it is a perfect integer. #include <iostream> using namespace std; int main() { int x; int iCount = 1; int sum = 0; cout << "Enter an integer to test (< 2 to …

Member Avatar for ashtonpearson
0
72
Member Avatar for banks2140

I need help with my C++ homework and im stuck. The problem is to write a program that reads a file of all lowercase and output each letter and how many times each letter occurs.... Here is the code i have and where i am stuck.... #include <iostream> #include <string> …

Member Avatar for Fbody
0
105
Member Avatar for harpay

This is my code for my program, it seems to work fine but the problem is i think roll has to be a char in order for q to quit to work when i implement the code in there. but when i use char, when i input the number i …

Member Avatar for emilo35
0
272
Member Avatar for Centz

I need to make a program that asks the user for their name and PIN number, then have it check the accounts file and see if that user is in there. If it finds a match it will output the users account balance. I have the text file set up …

Member Avatar for acerious
0
253
Member Avatar for YingKang

The main function looks so messy. I am wondering if there is a way I can move some of the code from the main function to Student.cpp. Could anybody help please? Thanks. [CODE] //main #include <cstdlib> #include <iostream> #include <iomanip> #include "Student.h" using namespace std; int main(int argc, char *argv[]) …

0
67
Member Avatar for gretty

Hello I have this task below & I need someone to tell me if I have done it correctly. The part where I am not sure is if I am correctly checking if the array is empty. [quote]Write a function to find the maximum value in an array of ints …

Member Avatar for Akill10
0
153
Member Avatar for martin_anastaso

Hello all, I have encountered a very bizzare (at least for me) problem when writing the output from my program to a file. I've written a program to solve numerically mean-reverting SDEs. The program takes some parameters and returns several dynamic arrays corresponding to the number of SDEs I have. …

Member Avatar for martin_anastaso
0
1K
Member Avatar for abhishekrs
Member Avatar for a-hall

I have setup an array and i have calculated the sum of my array. Now i need to find standard deviation of the numbers entered in my array. here is my code [CODE]#include <iostream> using namespace std; int main() { int i=0, count, maxSize = 36; double arr[36]; double number; …

Member Avatar for Fbody
0
142
Member Avatar for sanjuanair
Member Avatar for Narue
0
124
Member Avatar for glenak

Hi, So I've been having problems with my Eclipse C++ IDE. In other words, I haven't been able to run anything, not even a hello world program. I think the problem has to do with the fact that I don't have a c++ complier in my system. I use Windows …

Member Avatar for glenak
0
150
Member Avatar for hq1

Hi I'm tryingt to write this program: Write an interactive computer program that will find the greatest common divisor of two integers using Euclid's Algorithm. The program should be independent of the order in which the two numbers are input. EUCLID'S ALGORITHM Divide the smaller number into the larger. If …

Member Avatar for Unimportant
0
112
Member Avatar for Beancounter5

Hello, does anyone know where i can find some good examples on the list::erase() command. Specifically when erasing elements of a list whilst looping through it with for..next ,etc..

Member Avatar for Ancient Dragon
0
111
Member Avatar for eme21

Could anyone help me..... My instructor give me an assignment and i don't know how to start and i should submit it in nextweek so can you think with me and help me to know way????? this the Question--> Consider the following description an account in a bank management system. …

Member Avatar for eme21
0
175
Member Avatar for #include<>

Why doesn't [code] typedef [I]ClassName[/I] SomeName[[I]SomeSize[/I]][[I]SomeOtherSize[/I]];[/code] work?

Member Avatar for mrnutty
0
107
Member Avatar for mitrious

I'm trying to use the tolower function from the cctype header ... in this function (to check if a word is a palindrome [code=c] int palindrome(const string& w) { typedef string::size_type sz; string ret = w; sz r = 0; sz l = w.size() - 1 ; int check = …

Member Avatar for Narue
0
132
Member Avatar for sterlingf5890

I wrote out a palindrome test program for my c++ class. It is to include 3 functions (one to count the length of the string, one to test if it is a palindrome, and one to output whether the string is a palindrome or not using a switch statement). Visual …

Member Avatar for Unimportant
0
136
Member Avatar for Mabalo

#include <iostream> #include <time.h> #include <stdlib.h> #include "/home/theodore/lotto" using namespace std; main () { srand(time(0)); int One, Two, Three, Four, Five; One = rand() % 35 + 1; Two = rand() % 35 + 1; Three = rand() % 35 + 1; Four = rand() % 35 + 1; Five …

Member Avatar for Unimportant
0
114
Member Avatar for iluwinter

Hello, I'm fairly new to C++, and I am currently doing a CS assignment, which is to create a hangman game. The only problem i'm having so far is that i'm getting an error when i try to pass a char array to a function (invalid conversion from 'char*' to …

Member Avatar for vidit_X
0
145
Member Avatar for pandaEater

I'm trying to make a binary search tree without using recursion anywhere. I'm having trouble with the destructor though. I've been thinking about using a stack to help me keep track of the nodes but I'm not sure exactly how I would implement that. Any ideas? Relevant code: [CODE] class …

Member Avatar for pandaEater
0
2K
Member Avatar for sonsofliberty84

I found Ancient Dragon's code snippet for reading the files in a folder. I modified it a little because I want it to display what those files are. The problem is, it also displays the two parent directories, '.' and '..'. I was wondering if there was a way to …

Member Avatar for sonsofliberty84
0
96

The End.