49,757 Topics
| |
My primary objective right now is to get the program to display the following, when the user presses 1 at the main menu: Size of 1st pizza order: Small Topping of 1st pizza order: No topping Size of 2nd pizza order: Small Topping of 2nd pizza order: No topping I … | |
Well, i'm pretty much a newbie into programming, merely because i'm just 15, but i really like informatics ( specially programing ) but i'm not that wealthy so, i can't pay for private teaching, or anything like that. But if you want to, you can, that's what i say. I've … | |
Hi all, Here is a short summary of my piece of code. [code] double availableUnits = calculateAvailableUnits(some arguments); int minimumRequiredUnits = getMinimumRequiredUnits(some arguments); std::cout<<"minimumRequiredUnits = "<<minimumRequiredUnits<<std::endl; //prints 30 std::cout<<"availableUnits = "<<availableUnits<<std::endl; //prints 30 if (availableUnits < minimumRequiredUnits) { //throw exception; } //rest of the code [/code] Even though both variables … | |
I want to get unix time in my program, google just brought up how to get time on a unix system (I'm on a dos/windows system). Is there an easy (can fit in less than 20 lines of non-system dependent functions and without any API or WIN32 [unless simple] functions) … | |
I have this assignment for adding two polynomials using operator overloading. I am new to C++ and am having trouble putting the pieces together for the operator overloading portion of the code. I understand how to add two poylnomials together, I just don't know where to begin to put down … | |
hi everyone I have been programing in c++ for a while now, but I'm asked to write project in c#, so is hard to learn it ?? also I have never wrote a program with interface , so is it possible to write console application then build the interface ? … | |
Okay, I am still trying to get used to C++ since I mostly write in Java. I am also new with the two constructor thing mentioned in detail below. Here, I am investigating on writing a class with two constructor. That is, I have heard that you are allowed to … | |
So I have three files all in the same folder: dtime.h, dtime.cpp, and testapp.cpp dtime.h: [CODE] //This is the header file dtime.h. This is the interface for the class DigitalTime. //Values of this type are times of day. The values are input and output in //24 hour notation as in … | |
hello , let me know , what is the best way to learn c++ efficiently , reading c++ books and doing exercises based on the each capter , or read a book , then to solve exercises?. I'm waiting a reply from those experienced people . Thanks. | |
So basically I need to find a way to evaluate an infix that's been converted into a postfix. The code below takes an entered infix and converts it into a postfix but I don't know how to take that postfix and evaluate it. Every single tutorial I've seen evaluates a … | |
Insert a few integer numbers between -100 and 100. Determine and print how many negative numbers and how many positive numbers have been inserted. Insert the value 0 to stop inserting. | |
I am slowly understanding functions, but I can't completely wrap my head around it yet. What is the purpose of function with nothing in the parentheses? Like this something(). Also, is there a way to write a function and then have it output what is going on in that function? … | |
Hello, I am getting the following error from line 108. I'm trying to find information on the error. The elapsed_time function returns a double, so I'm not sure where there is a problem. error C3867: 'Timer::elapsed_time': function call missing argument list; use '&Timer::elapsed_time' to create a pointer to member [CODE]#include … | |
I have some question about boost::promise After studying the website of boost and "C++ concurrency in action" I still can't get the idea of boost::promise According to the book(if I have no make any mistake) boost::future is designed for one off event you could wrap the task by packaged_task and … | |
I'm working on a small concept demo for a friend and I'm stuck on the UI. I'm trying to build something akin to an FPS interface (using mouse-look and the iconic WASD). I'm working in a Windows environment (Win7 to be precise), so I figured I'd use the standard Windows … | |
[B]Perfect number cousins[/B] 6 is a perfect number. but 220 and 284 are perfect number cousins. because the sum of the divisors of 220 is 284 and the sum of the divisors of 28 is 220. so they are called perfect number cousins. write a program that finds and writes … | |
Hi, I would like to write a member function with a default argument, but the value of the default argument I would like to use is the value of the classes data member [CODE] class testdf {// testdf private: const int _defaultVal; public: testdf() : _defaultVal(1) {} int testMF(int arg … | |
I'm trying to isolate a first name, space, middle initial, space, and last name. The full name is given by the user. The only problem I'm having is isolating the middle initial. Current code: [CODE]#include <cstdlib> #include <iostream> #include <string> using namespace std; int main(int argc, char *argv[]) { string … | |
Not sure if anyone is familiar with column sort. I have this very close to working, but there are a few instances where the numbers are out of order. They occur at the beginning of each new column. I am looking for bugs in my transpose(), reverse_transpose(), shift(), and reverse_shift() … | |
I've tried searching for articles that relate to this issue, but all I keep finding are articles about people who don't know how to define constructors/can't call the parent constructor/etc and I think this will cut straight to the chase. The problem code is as follows: [CODE] #include <stdio.h> class … | |
I am making a application for maping some keyboard shortcuts to some event. So, i need detecting the keyboard shortcuts pressed after clicking a button. For Example, i have a button having text on it "change". When i click on it text on it changes to "press keys" then i … | |
hey i just switched from turbo c++ to dev c++ i cant run the following program please help #include<iostream> using namespace std; int main() { int n; int k; cout<<"Enter the values\n"; cin>>n; cin>>k; if (n>k) {cout<<"The value entered first is greater ";} else {cout<<"The value entered 2nd is greater";} … | |
hey guys, I'm writing a program and trying to output data to a file and I'm getting this error: 1>------ Build started: Project: GenericProgram, Configuration: Debug Win32 ------ 1> Source1.cpp 1>c:\program files (x86)\microsoft visual studio 10.0\vc\include\fstream(1116): error C2248: 'std::basic_ios<_Elem,_Traits>::basic_ios' : cannot access private member declared in class 'std::basic_ios<_Elem,_Traits>' 1> with … | |
I am inserting all of the words in the dictionary into the unordered_set STL. For the life of me, I cannot figure out how to override the default hash function for the unordered_set. Can someone please point me in the right direction? I cannot figure out the syntax. Thank you … | |
Question: Write a single statement that chooses a random number from each of the following sets: a) 2,4,6,8,10 b) 3,5,7,9,11 c) 6,10,14,18,22 I wrote the following statement for the set (a): [CODE](1 + (rand() % 5)) * 2;[/CODE] but I am unable to write ones for sets (b) and (c). … | |
hi every body i m doing project of hand gestures detection using open cv .so pls guide me how i detect hand from video . | |
Here is my problem: 1) I have a tree which I want to act upon some branches indepedantly and simultaneously by different threads 2) The program is structured so that the processing of each branch is isolated after the main "manager" thread delegates the work to different thread: memory of … | |
I am studying CH4.3.2 of the book "C++ concurrency in action" , the book mention about "synchronizing with message passing" and give the reader some basic idea about it but without details(how to implement it). Could I find some simple examples which implement MPI by boost::thread? Since I haven't grasp … | |
hello my dear friends I have read a book that was simple to learn c++,recently But in operator ovorloading threads ,I dont underestand many example for ovoreloading in another books & booklets for example : in the example below 1 // Fig. 11.3: PhoneNumber.h 2 // PhoneNumber class definition 3 … | |
How do I define a function that reads a sequence of values from an input stream that is passed as an argument? |
The End.