49,755 Topics

Member Avatar for
Member Avatar for yesamin

hello how can i do a for loop .. for a guessing game... and the only 5 oportunities to answer..... forexample no you wrong u have 4 guess left" heres my code !!1 this one just keeps giving me an unfishing loop grrrr!!! [CODE]#include <iostream> #include <string> #include <cstdlib> #include …

Member Avatar for Unimportant
0
2K
Member Avatar for Garrett2011

Consider following function: [CODE]void func(const char & input){ //do something }[/CODE] Apparently it makes sense for the parameter to be constant value not reference to constant, Now may a compiler optimize that to constant value so that it'll be the same as following ? [CODE]void func(const char input){ //do something …

Member Avatar for Narue
0
135
Member Avatar for stevanity

Hi Guyz, Here is a really tough problem to solve. Anyone can help out? You need to encode and decode a message in a parallelogram matrix. Eg. If input message is, "This is a problem" then you must put it inside a odd order matrix whose order is determined by …

Member Avatar for stevanity
0
369
Member Avatar for jogieglenmait

i know that its so easy. but i dont know how to do it. ive tried ifstream and ofstream to add a line in a text file. and im sure someone in the past may have already posted this kind of problem. can anyone give me a link to that …

Member Avatar for jogieglenmait
0
121
Member Avatar for malvi

Hello, I am working with rs232, and i have to write program in visual c++ which reads continous data from rs232. For that first i need to open available com ports from pc. I have COM3 in my pc, but i have to write com3 manually in my program. Is …

Member Avatar for peteratoce
0
2K
Member Avatar for Morbane

I have a basic knowledge of C++ but mostly in a limited fashion. I am building an API and I need to send the resulting string to a text box in a Modal Dialog. I will not need to manipulate the string beyond sending it to the text box. The …

Member Avatar for Morbane
0
2K
Member Avatar for bakks

i gto some prob to create this c++.. my Qs this year the club will have an election by assuming that this club have 236 members where 3 will be the candidate of a club president. every member will vote only 1 candidate using the following code : candidate code …

0
40
Member Avatar for MikexDetroit

Hey all, I've spent the last couple hours looking at other posts with the same error and have still yet to figure out what is wrong. I'm just learning C++, I have a bit of experience with Python but, still just getting my feet wet. Here is the code. [CODE] …

Member Avatar for MikexDetroit
0
902
Member Avatar for Intrade

I followed this guide for VC++ 2010, [url]http://msdn.microsoft.com/en-us/library/ms235636.aspx[/url] and apparently I either have a missing module/component or I did something wrong. I followed everything smoothly up until step 6-- "6. To build the project into a DLL, from the Project menu, select MathFuncsDllProperties…. On the left pane, under Configuration Properties, …

Member Avatar for Intrade
0
267
Member Avatar for limergal

Hi, I have a code, but I don't get what I'm doing wrong, can you please help me with this Write a switch statement that tests the value of the char variable response and performs the following actions: if response is y , the message Your request is being processed …

Member Avatar for bhemz11
0
562
Member Avatar for mannuel1021

[CODE]#include<iostream> void selectsort(int*,int*);//function prototype int *smallest(int*,int*);//function prototype void exchange(int*,int*);//function prototype void printlist(int*,int*);//function prototype using namespace std; void main() //this will ask the user to give five integers inside the array and will display it { int *name; const int size=5; int size2=5; name = &size2; int ary[size]; int *plast; plast …

Member Avatar for csurfer
0
192
Member Avatar for burcin erek

this program is trying to add from 1.. to x with return function. but when I enter 10 sum is 54 which is wrong. 1,2,3,4,5,6,7,8,9,10 = 55 [CODE]#include <cstdlib> #include <iostream> int burcin(int); using namespace std; int main(int argc, char *argv[]) { int x; int ft=0; cout << "enter the …

Member Avatar for burcin erek
0
103
Member Avatar for baltair

Hello, I am trying to create a shop where the user can pick an item to add to their cart and after they pick the item, I want to remove it from the list, but I can't seem to remember on how to do it. [CODE] int main( void ) …

Member Avatar for baltair
0
101
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 copied the example from the book, but the code is not working. I got a lot of errors in Phone_Directory.cpp. I dont know what to do [CODE] …

Member Avatar for Intrade
0
263
Member Avatar for YingKang

I keep getting compiler errors. Could anyone help please? Thanks This is the error message: F:\DPR226\Homework\Student\main.cpp In function `int main(int, char**)': 39 F:\DPR226\Homework\Student\main.cpp invalid conversion from `int' to `int*' 39 F:\DPR226\Homework\Student\main.cpp initializing argument 4 of `void Student::setStudent(std::string, std::string, std::string, int*)' F:\DPR226\Homework\Student\Makefile.win [Build Error] [main.o] Error 1 [code] // main.cpp #include …

Member Avatar for vidit_X
0
117
Member Avatar for Ferny84

I'm having problems with this c++ program. I need to read a file containing years on each line, and determine if the year is a leap year. The isLeap function looks fine, i'm just having problems actually reading the file and implementing the function. Can anyone help me out? [CODE]#include …

Member Avatar for Ferny84
0
129
Member Avatar for power_computer

Hello all, I am given a project and would like some help/guidance from the community. I am not asking for any code just a direction and little advice on how to approach this project or how these things work per-say. I am behind in my classes due to me having …

Member Avatar for VernonDozier
0
1K
Member Avatar for NV43

I'm having a problem being cause by what I believe to be my getMonthValue function which is resulting in my output always being "Saturday." Can anyone give me any reason this is happening? Thanks. [CODE]#include <iostream> #include <string> using namespace std; bool isLeapYear (int year); int getCenturyValue (int year); int …

Member Avatar for goldzero
0
132
Member Avatar for jtxay

Okay well i'm having trouble understanding this program ..in which our professor doesn't even explain..I'm so lost.. I hope somebody can help me please.. here's the problem... I have to write a program in c++ that computes the number of days between two dates using the Julian day number which …

Member Avatar for Akill10
0
258
Member Avatar for bigwhiteegg

for some reason the following function has return numbers of error such as 1. new types may not be defined in a return type 2. two or more data types in declaration of `initialize' 3. ambiguates old declaration `GrowableArray initialize(GrowableArray&)' [CODE]void initialize(GrowableArray &a) { unsigned zero=0; a.elements=zero; a.element=NULL; }[/CODE] and …

Member Avatar for bigwhiteegg
0
3K
Member Avatar for mcook228

I have an assignment to write code to calculate a cubic spline. The values for my coefficients are correct, but the Gaussian elimination part of my program has me really confused. I was given code in C by my instructor, but am struggling in making it work with my code. …

Member Avatar for iamthwee
0
1K
Member Avatar for alex55

So i have a string say string A = junk#crap i want to separate it to separate strings b=junk c=crap how would i go about doing that while throwing out the #?

Member Avatar for alex55
0
146
Member Avatar for fallen_prisoner

hi i am new to programming and have had problems installing C++ on vista. Is it possible to get C++ working on vista or will I need to switch back to XP or ubuntu? Does Bloodshed work on vista?

Member Avatar for asmail2020
0
172
Member Avatar for David_Omid

This is a section of code: [CODE] this->SquareImage1->Visible = false; this->SquareImage2->Visible = false; this->SquareImage3->Visible = false; this->SquareImage4->Visible = false; this->SquareImage5->Visible = false; this->SquareImage6->Visible = false; this->SquareImage7->Visible = false; this->SquareImage8->Visible = false; this->SquareImage9->Visible = false; this->SquareImage10->Visible = false; this->SquareImage11->Visible = false; this->SquareImage12->Visible = false; this->SquareImage13->Visible = false; this->SquareImage14->Visible = false; this->SquareImage15->Visible …

Member Avatar for David_Omid
0
96
Member Avatar for arsnic

Hey guys (and girls) I'm not new to C++ but it has been a while since I've used it. I'm having an issue that I can't seem to place my finger on. I have the two bits of code below. The first comes out fine, or as I expect the …

Member Avatar for arsnic
0
220
Member Avatar for JwhateverJ

Is there a way to add months and their respective days in my + operator?[code]Date operator + (Date const& dt, Month const& m) { jdn_type months_to_add = m.month_; jdn_type days_to_add; gregorian_type g = dt.gregorian(); long d = std::get<1>(g); if(d == 1){ days_to_add = 31*m.month_; } else if(d == 2){ days_to_add …

0
101
Member Avatar for sahil1991

hi, i know structures are basically used for holding data members whereas classes can hold both functions and data members. but contrary to the definition of structures can they also hold functions?? i read that they can but there wasn't any explanation about it. hopefully,some of few can come up …

Member Avatar for sahil1991
0
102
Member Avatar for jjacob201

I would like to create a c++ program that captures images from a ccd every few seconds and saves them to a folder. This will later be used as part of an image tracking package for an autoguided telescope. I have no clue where to start. If anyone has experience …

0
44
Member Avatar for Fbody

I have a couple of template classes "Stats<T>" and "Numerical<T>" within a "Statistics" namespace. The Numerical<T> class inherits publicly from Stats<T>. They are defined as below.[CODE] namespace Statistics { //declare Statistics namespace template <typename T> class Stats { protected: vector<T> dataSet; //contains the actual data set to be analyzed /* …

Member Avatar for Fbody
0
87
Member Avatar for agaba

This is my Code #include<iostream> using namespace std; struct BankAccount { int accountNum; double accountBal; double rate; }; int main() { const int ACCOUNT = 5; BankAccount info[ACCOUNT]; int sub; double balTotal = 0; double balAverage; int accountNumber; bool isFound = false; for(sub =0; sub<ACCOUNT ; ++sub) { cout<<"Enter Account …

Member Avatar for agaba
0
102

The End.