49,761 Topics
| |
Hey daniweb, I stumbled upon an issue I can't solve myself. Here is the code : #include <sstream> #include <iostream> template <class T> inline T htot(std::string str) { T x; std::stringstream ss; ss << std::hex << str; ss >> x; return x; } int main() { int x = htot("0x0F"); … | |
I am doing something wrong, I have tried for two days and I still cannot figure it out. Can someone help me? Thank you. [code] #include <iostream> #include <iomanip> #include <cmath> using namespace std; void instructUser(); double doDivideZero(double &); int main() { instructUser(); double displayedVal; double newEntry; char command_character ; … | |
I dont know what goes wrong in this code... Help me here I simply want to save the initial and final positions after dragging the mouse... #include"iostream" #include<glut.h> class point1 { public: point1() { x=0; y=0; } int x; int y; }p[2]; int flag=0; void processMouse(int button, int state, int … | |
How to write a program use pointer on array that needs eleven numbers, compute their average and find out how many numbers are below the average?. | |
Hello everybody, I'm a beginner in the world of game programming. I'm working on Pacman project in C/C++. I want to know if any such 2d game requires an IDE to compile or execute it succesfully? Or is it possible to write a program to run Pacman with graphics.h and … | |
question is: Give 5 type checks that should be made for the following c++ statement: x=f(v[i]); NOTE: assume x, f,v and i are all declared and in scope. 1. compatibility check (compile time) 2. v[i] is a valid array element. (compile time) (i.e. (i is not a float or something)) … | |
I'm nearly complete in figuring out this program, but for some odd reason, my program will either output "segmentation fault" or a "floating point exception" when it attempts to evaluate the postfix expression. The objective of the program is to take in an infix expression, convert it to postfix, then … | |
I had to make a program that calculates how much you gain or loose in a stock markect. I have everything worked out excpet how to use char. I've looked it up but i don't understand anything. Can you help explain it to me? // Project 6.4. Calculates how much … | |
i have a problem conversion from char to LPTSTR as parameter, could anyone help me,, for example char temp[10]="abcde"; how convert to LPTSTR from char above?? thanks | |
Same project as before but now I have diffrent Errors. fatal error C1075 and error C2450. //Project 7.4. Program determines what your weight would be on another planet.2.3. #include <iostream> #include <cmath> using namespace std; int EarthWeight ; int WeightOnPlanet, Mercury, Venus, Mars, Jupiter, Saturn, Uranus, Neptune, Pluto ; int … | |
#include<iostream> #include<iomanip> using namespace std; class circleType { public: void setRadius(double cRadius); double getRadius() ; double calcArea() ; double calcCir() ; void print() ; circleType (); circleType(double cRradius); private: double radius; }; void circleType::setRadius(double cRadius) { radius = cRadius; } void circleType::print() { cout << "The radius of the circle … | |
I'm trying to display the pegs of the Hanoi Towers recursive algorithm. I want each step to appear separately as such: For example if the number of disks is 2 A: 2 1 B: C: ---------- Move disk 1 from A to B A: 2 B: 1 C: ---------- Move … | |
the program is to print a bill using two classes-customer and item.... in class customer, members are itemname and customer name.in item, members are itemname itemcode,itemprice,noof items...and functions to calculate bill and update stock. iam in confusion with the logic.....i think that it can be done by using nested class??? | |
PART 1 of my Project:Using turbo c++ 4.5, and I'm very new to Programming, i'm not good 1. I made a program which stores 100 records please check if it's right. 2. I want to read each line into an array. I want to use a struct or what they … | |
So I'm trying to right a code to output some simple data using classes. Everything works accept the retail price function. It's suppose to calculate and output the retail price but it only outputs 0 no matter what numbers I eneter. Can anyone give me some suggestions on how to … | |
**Hello :) can somebody help me how to put the quantity and adding a receipt also the a1, a2, a3, a4 (for example i chose the a1 and it will ask me how many order and do you want to order more? if not it will go to the payment … | |
i need some help/ having trouble in making this program for homework: Create a C++ program which calculates student fees for those attending Santa Monica College. IN ORDER TO RECEIVE FULL CREDIT, YOU MUST CREATE FUNCTIONS TO SOLVE THIS PROBLEM WITH BOTH PASS-BY-VALUE AND PASS-BY-REFERENCE PARAMETER (No, main() doesn't count). … | |
I have an array of structs that contains an account number and a balance. I open a file which contains an account number and an amount that needs to be either added or subracted from the correct account. My problem is it is adding and subracting to the first account … | |
0001 Bread Bakery 35.00 0002 Soap Hygiene 20.00 0003 Milk Dairy 40.00 0004 Apples Fruit 30.00 0005 Gelatin Snacks 15.00 0006 Candy Snacks 25.00 0007 Catsup Condiments 40.00 and so im trying to read this grocery.txt file...i'm thinking of using an array...the code ive done would read the first line … | |
in my college we are runnig c++ by creating a directory from cmd and this commands goes like this cd\ cd rollno set path=c:\tc\bin tc this created dir in c folder and also saves our pgms with our roll no so what i want is iwant to implement it in … | |
if im doing a dll in dev c++ ..... and doing a dll in c++ but using visual studio 2010 is both of them gonna be the same?? i mean..ermm..if the computer doesnt have the visual studio will they be able to run my dll project which using c++ language... … | |
I have a project to create a pointer based linked list. I am having a problem with the contains() indexOf() and lastIndexOf() methods. I am not able to compare iter->item!=o. This is my ArrayList.cpp. I will follow it with ArrayList.h and Country.h (the ArrayList uses a typedef of the Country … | |
I am trying to implement a function sameMonth from a class to compare two user entered months. My class is declared in a header file "Date.h": #include <iostream> using namespace std; class Date { private: string month; int day; int year; public: Date(); Date(string aMonth, int aDay, int aYear); void … | |
Can anyone help me with this constructor problem? In main: instantiate one date object (date1) using the default constructor just to see that the constructor works, print the month, day, and year of date1 using the getters get input from the user and use the setters to set the values … | |
Hi guys I been programming in c++ for past 2 years and is fairly good with it. First of all I dont need the code or anything but need some resources which i can use to get the basic idea so I can start developing. Had been googling for the … | |
So I'm beginner starting software enginering studies here condition: Given number n ( n<=9999) need to identify if this n is palindrom(ex. 7777,8228,0220...). Need to write in c++ language.thanks | |
im writing a program that creates a dynamic array then input numbers(not exceeding 100). i used *new int* to create the array. im running into the problem that it only allows 21 numbers to be entered, then does sort,mean. could anyone explain where im going wrong setting up the array … | |
I had absolutely no clue where to post this but I figured since it crashes on the C++ side, I'd ask here. I have the following code: Java side (Loads My C++ DLL just fine.. Passes it a ByteBuffer so that I can write to that): import java.io.IOException; import java.awt.*; … | |
How can i draw a 1 line border or frame around code using an " * " , searching the net i have seen techniques using loops and various functions but i cant grasp the concepts being used, even a link to a indept tut on this would be a … | |
... The name of program is i think it is function and structured programming waa hard to explain ahmm.. if you input a number 1 temperature must be goes in program then after that i need to input an exit like "ARE YOU SURE YOU WANT TO EXIT?" then Y … |
The End.