49,761 Topics

Member Avatar for
Member Avatar for Tinee

Hi, Im trying to compare an inputted string to an array of string. If the inputted matches one of the array of string it should return 0, but if not it should return 1. Any suggestion on how to do this? This is my program: [CODE]{ for ( int j=0; …

Member Avatar for Tinee
0
249
Member Avatar for eduard77

I would like to take a diploma in c++ programing. Anyone could help me find the best online university ? Thanks

Member Avatar for eduard77
0
86
Member Avatar for narunaru

I'm a beginner programmer and I'm trying to make a add function that adds two numbers. but these numbers are passed by strings. ex. four + five = is 9. if the answer goes over 10m then it prints out "error". can anyone help me ?? [ICODE] int add (string …

Member Avatar for Dexxta27
0
115
Member Avatar for bkoper16

Im trying to make a program that has a base class Account and a class ,Savings , that inherits from it. however i keep getting an error that says expected class name before { token and it shows it where i wrote [CODE]class Savings : public account { [/CODE] there …

Member Avatar for griswolf
0
9K
Member Avatar for Jsplinter

All things equal, does an object of a class which has methods take up more memory resources than an instance of a class without methods. What if it is a vector of such objects? For example: [CODE] class A{ public: void DoSomething(); void DoSomethingelse(); private: int x, y; }; class …

Member Avatar for mike_2000_17
0
136
Member Avatar for cousinoer5

This program keeps track of a hardware store inventory. It's very barebones, all it needs to do is put the information into a vector of pointers to a struct, allow the user to sell items, and print the report. I have printing down no problem, but selling is where I …

Member Avatar for Chilton
0
178
Member Avatar for n0de

Hi, i have some issues with class inheritance and i do not know how to solve it, maybe someone could help me with that ? [CODE] //pentathlete.h #include <iostream> using namespace std; template < class T > class pentathlete { protected : T comp_res [ 5 ] ; /*private: int …

Member Avatar for n0de
0
157
Member Avatar for andimiami

In my function, I am using .find and I need to be using .at, because the way I have it now doesn't account for extra whitespace etc., but I have no idea how to implement this change. I looked through the internet and I can't find a good example of …

Member Avatar for andimiami
0
119
Member Avatar for clickspiker23

I am supposed to read in data from a file and store it. I know how to read from a file and display it, in main, what i don't understand is how to do that with classes and objects. This is the part im having a little trouble with and …

Member Avatar for jjman4562
0
168
Member Avatar for rattlesnake_bac

Hello, i need a simple C/C++ program that sends SMSs via the attached GSM modem. I have some experience in C programming, but i haven't controlled the COM port. Also, i need to give 2 variables , one for the recipient's number, and second for the actual message. So, when …

Member Avatar for sunnythesun
0
824
Member Avatar for Khoanyneosr

So, I've bought two books, one on DirectX 10 and one on OpenGL. The first one i bought was the directX 10 book, and NONE of the code compiled because of some LPCSTR error. So stupid me thinking it was another thing that microsoft goofed on i bought a book …

Member Avatar for pseudorandom21
0
342
Member Avatar for dodgers

Hey. My program wont write the input data to file. It seems like the userdata variabels doesnt get updated after input from the user. Can anyone see what i have done wrong? This is what i have done so far: [CODE] // userdata.cpp // class userdata store user information #include …

Member Avatar for Moschops
0
166
Member Avatar for inzombiak

Hey, let me try explaining what i need to do with an example Example Before sorting arr1 = {15,12,18,11} arr2 = {1,2,3,4} arr2 is always in ascending order and its length is based on the number of elements in arr1 After sorting arr2 = {2,3,1,4} So basically i need arr2 …

Member Avatar for thekashyap
0
132
Member Avatar for thekashyap

Hi, I was implementing the Exampler / Prototype pattern just to brush up on C++. Couldn't figure out how to do the cleanup at the end. Problem is deleting all the prototypes from the map in base class at the end. I.e. deleting all stored pointers in [ICODE]Animal::examplesPtr[/ICODE], which is …

Member Avatar for thekashyap
0
100
Member Avatar for Khoanyneosr

[CODE]#ifdef _WIN32 #include <windows.h> #endif #include <iostream> #include <vector> #include <string> #include <SDL/SDL.h> #include <GL/gl.h> #include <GL/glu.h> using std::vector; void error(const std::string& s) { #ifdef _WIN32 MessageBox(NULL, s.c_str(), "An error occurred", MB_ICONINFORMATION | MB_OK); #else std::cerr << s << std::endl; #endif } [/CODE] That's my problem... [CODE]1>------ Build started: Project: …

Member Avatar for Khoanyneosr
0
199
Member Avatar for pepperhead11

Ok, I've been trying to run this program on Borland C++ (Version 5.0A). The program is a Point of Sale program. I keep getting the errors "expression syntax at (121,26)" and "If statement missing ) at (129,6). Try as I might, I can't seem to fix the errors. Help? [CODE] …

Member Avatar for WaltP
0
1K
Member Avatar for gcardonav

Hi guys: I created this program that will read into two files and compare a number from one file into the other and if they match, it will print out some information. I ave two if statements and it seems that the second one can't be read. I tried putting …

Member Avatar for WaltP
0
209
Member Avatar for Sonia11

I ma brand new to templates and I have been given an exercise to reverse the elements using vectors which I did perfectly. But I need to include the template thing which I tried my level best to understand and do but still I am getting many errors. Any help …

Member Avatar for L7Sqr
0
170
Member Avatar for NoUserNameHere
Member Avatar for NoUserNameHere
0
120
Member Avatar for AliRaiz

first my task was to write this program that checks that string t contained in string s or not and i successfully made it and now i have to change this program a little bit and now i have to use a bool function in this program any one can …

Member Avatar for AliRaiz
0
96
Member Avatar for jimJohnson

I am finishing up this program and need to find the GCD using euclids formula. I am attaching my code and was seeing if anyone could show me what is wrong. I am also sending the instructions just in case you need it... [code] //Programmed by: Bryan Kruep //Date: 2/22/2010 …

Member Avatar for jimJohnson
0
352
Member Avatar for clickspiker23

i keep getting this error in my main.cpp [code]main.cpp:17: undefined reference to `Game::Game()'[/code] this is the code i have pertaining to the error [code] #include "Game.h" #include<iostream> #include<cstring> #include<iomanip> #include<cctype> #include<fstream> #include<string> int main() { ifstream din; Game output; output.fillGame(din); return 0; } [/code] i doubt it but just in …

Member Avatar for clickspiker23
0
140
Member Avatar for caut_baia

[code] class A { virtual void func()=0; }; class B : public A { void func (); }; class C : virtual public B { void func(); }; //I receive an A* pointer through a function in an LPARAM type argument //and i must downcast from an A* to a …

0
63
Member Avatar for andimiami

I need to take an input file that contains name listed like: John Henry Mary Baker and create an output that looks like: Baker, Mary. Henry, John. Right now my output is just ,. ,. ,. ,. ,. ,. I can't use any global accesses, or a character processing alogorithm. …

Member Avatar for Moschops
0
131
Member Avatar for prahesh

Hi All, I want to register the .dll files in my setup project. I am creating the Setup project for installing it on 64 bit Windows 7 machine, And I have successfully installed on 64 bit Machine. The issue is, while running the application installed on the 64 bit machine, …

Member Avatar for prahesh
0
641
Member Avatar for failbot

Hi, I am working on this code: [CODE]#include <iostream> using namespace std; send(to, from, count) { register int *to, *from; register int count; { register n=(count+7)/8; switch(count%8){ case 0: do{ *to++ = *from++; case 7: *to++ = *from++; case 6: *to++ = *from++; case 5: *to++ = *from++; case 4: …

Member Avatar for failbot
0
224
Member Avatar for clickspiker23

Im trying to read from a file using classes and objects. i keep getting this error [CODE]main.cpp:16: error: no matching function for call to ‘Game::fillGame()’ Game.h:41: note: candidates are: bool Game::fillGame(std::ifstream&)[/CODE] here is code that goes with the error [CODE] //Game.h bool fillGame(ifstream & din); [/CODE] [CODE] //Game.cpp #include<iostream> #include …

Member Avatar for jonsca
0
137
Member Avatar for munitjsr2

[CODE] #include <iostream> #include <vector> #include <algorithm> using namespace std; class A { public : void getData(vector< A > &); void putData(vector< A > &); private : int x; char name[90]; }; vector< A > v; void A :: getData(vector< A > &Aref) { cout << "id = "; cin …

Member Avatar for munitjsr2
0
239
Member Avatar for narunaru

Hi, I'm a beginner programmer and I have an assignement of making the radix sort! My plan is to make a helper function that will return the place value of a number. (for example, if the number is 127, then the function will return either a 1, 2 or 7) …

0
58
Member Avatar for Robbie Y.

Hey guys! I'm trying to write a program that involves a switch/case on Microsoft Visual Studion 2010. Unfortunately, some of my variables are not being initialized. I am a very novie programmer so please have mercy on me! Two of my options (1,4) are working but options (2,3) are not. …

Member Avatar for Robbie Y.
0
170

The End.