49,755 Topics
![]() | |
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 … | |
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 … | |
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 … | |
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 … | |
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 … | |
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 … | |
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 … | |
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] … | |
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, … | |
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 … | |
[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 … | |
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 … | |
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 ) … | |
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] … | |
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 … | |
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 … | |
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 … | |
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 … | |
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 … | |
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 … | |
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. … ![]() | |
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 #? | |
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? | |
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 … | |
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 … | |
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 … | |
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 … | |
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 … | |
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 /* … | |
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 … |
The End.