49,757 Topics
| |
Hello! Well, I've been given a fairly difficult assignment (at least to me), and I can't seem to wrap my head around some parts. Here are the objectives: [I]"In this assignment you will demonstrate your ability to design a class and provide its declaration (.h) and implementation (.cpp) files. All … | |
Well, in this program I want it to take in a string or character array I really don't care which, for this instance I wouldn't know which is better. Afterwords, it compares those in if statements and sets a variable to a 1(female) or 2(male). Anyways, here is what I … | |
I need to output picture of a rocket using * the program works. The top of the rocket doesn't line up with the body of the rocket. Can someone point me in the write direction on how to start it. the function i am using is called drawCone. [CODE]#include <iostream> … | |
[B]I included my original code down below....Basically I need some input on where to start off. From what I can tell it seems that I will need to re-organize the code into functions, while implementing the new data structure. Any input would be greatly appreciated.[/B] This time the program would … | |
Hey. I have this assignment in which i've to generate prime numbers up to a certain limit. Since i'm extremely new to C++ so i have absolutely no idea what's wrong with the program i have written. I have to keep it simple for my understanding. I've written it in … | |
hy every1... how are yuo all... plz can any one solve my problem which is followings... [B]Using stack determine whether a world is Palindrome or not...????[/B] | |
About "error: assignment of data-member ‘A::pCost’ in read-only structure". Hi there, I got an error as above. My requirements are: I need a derived class A from class B. In A, there are two member functions, i.e., Initialise() and GetCost(). The Initialise() initialises pointer pCost pointing to an array, and … | |
Hi all people I've written program below for a physics problem. [CODE]#include <iostream> #include <conio.h> #include <math.h> #define g 9.8342998109761958158459616185564 using namespace std; long double theta(unsigned long int n,unsigned long int N){ return (M_PI/2)-n*(M_PI/(2*N)); } long double V(unsigned long int n,unsigned long int N,unsigned long int h){ if(n!=0){ long double … | |
Below has the source code to the program Im writing... anyway I want to do this... I want to be able to include a file from the project in my executable... Example: If I put the program on a different computer, I want it to able to open a file … | |
HI Friends i need to convert TCHAR to Boolean value [COLOR="Green"][B]This is what i want[/B] [/COLOR] [COLOR="Red"][CODE]_TCHAR gstrEnableproxy="false" o/p: boolean x=false[/CODE] [/COLOR] [B] and the code i have written is [/B] [CODE]void convertStringBoolean(String* TCHAR) { bool boolVal = false; try { boolVal = system::Convert::ToBoolean(TCHAR); } catch(System::FormatException*) { System::Console::WriteLine("The string TCHAR* … | |
I want to pass a function in an object, is it possible??, how would i prototype the class constructor to accept that, given the class pass below and the function show() so that i would create an object and pass it ie [code] pass item(show()); [/code] [code] void show() { … | |
I am getting an expected primary-expression before '=' token, how can I fix this? [CODE]void vldtmv() { if ( brd[opx][opy].cont[1]=='H' ) { if ( ( npx - opx !== 2 && -2 || npy - opy !== 1 && -1 ) && (npx-opx !== 1 && -1 || npy-opy !== … | |
I think the following problem is a basic one in numerical codes: Suppose that we would like to do a for loop [CODE] for (double x = 0; x < Y; x += dx) { // numeric code } [/CODE] The problem is that if we set dx=0.1 it is … | |
Hi, I am creating a chess program. I am creating each piece on the board. But when I try to compile the bishop piece I get this error [B][I]FATAL : Out of Memory in function set.[/I][/B] What does this mean? | |
Hi for all, I'm newer with Delphi can anybody help me to convert the following c++ code to delphi7 one's. many thanks in advance c++ code : ********************************* #include <stdio.h> #include <stdlib.h> #include <signal.h> #include <ctype.h> #include <string.h> #include <errno.h> #include <sys/param.h> #include <sys/types.h> #include <netinet/in.h> #include <sys/socket.h> #include <netdb.h> … | |
Hello; I need to develop a money class that will simulate the cash box of a register. The cash box will contain coins and currency in the following denominations: $100, $50, $20, $10, $5, $1, $0.25, $0.10, $0.05, and $0.01. I am barely new in C++. I couldn't figure out … | |
Can someone help me figure out how to either round up or down down the numbers? The numbers are used with the asterisks in the bar graph. I'm not sure if I should be using fmod or the round function. Any help would be appreciated. [CODE] #include<iostream> #include<iomanip> #include<cmath> using … | |
Hello, Basically I'm trying to use operator<< to display items from a linked list. coding in the header file. [CODE] template <class DataType> struct Node { DataType info; Node<DataType> *next; }; template <class DataType> class LinkedList; template <class DataType> ostream & operator<<(ostream & output, const LinkedList<DataType> & rlist); template <class … | |
Hi everyone, can anyone tell me what is an alternate of graphics.h in visual studio/visualc++. Graphics.h is not working on my turbo c complier.plz tell me.. | |
Ok so I've got this homework problem thats killing me. Here's the problem: A bank account charges $10 per month plus the following check fees for a commercial checking account: $.10 each for fewer than 20 checks $.08 each for 20-39 checks $.06 each for 40-59 checks $.04 each for … | |
in my code i have declared [CODE]typedef signed long long int slong; const slong limit=4000000; const slong limitsqr=2000;[/CODE] i then created an array [CODE]slong* array=new slong[limit];[/CODE] without any problem. when i try this [CODE]slong* newarray=new slong[limitsqr][limitsqr];[/CODE] i get the error message: in function int main() cannot convert slong(*)[2000] to slong … | |
[CODE]#include<iostream> #include<iomanip> #include<string> class Pizza{ public: std::string type; std::string size; int toppings; Pizza(){} void setType(std::string type){ type = type; } std::string getType(){ return type; } void setSize(std::string size){ size = size; } std::string getSize(){ return size; } void outputDescription(){ //cout<<"A " cout<<getType(); cout<<" pizza; } }; int main(){ Pizza large … | |
Hello, I want to write a program in C++ that approaches the number pi by using the Monte Carlo algorithm. Therefore I need random numbers. When the amount of random numbers goes to infinity, the probability will approach the theoretical propability, which is a function of pi. I know all … | |
Hi there. I am trying to create a class rectangle. It should have data members length and width of type float (which should default to 1). The class should have member functions that calc. area() and perimeter() and also separate get() and set() functions for length and width. These should … | |
[code=c++]while(!infile2.eof()) { size_t found; string temp2, store, wordtobold; string command1 ("bold"); size_t prev_pos = 0, pos = 0; getline(infile2, temp2); store += temp2; found=store.find(command1); if (found!=string::npos) wordtobold = store.substr (found+4); while( (pos = wordtobold.find(' ', pos)) != string::npos ) { string wordtotag( wordtobold.substr(prev_pos, pos-prev_pos) ); cout << wordtotag; prev_pos = … | |
Hi i was wondering if someone could tell if i am anywhere close to being on the right track. I have to create a program which adds, subtracts, multiplies, and divides fractions. I really am trying to get a grip on learning this stuff, so anyone who could give some … | |
I wonder if anyone can point out the source of my error. I am using the SDK for commercial software which _requires_ that I build etc in Visual Studio 2008. I confess that my C++ is rusty at best and that I don't understand a lot about using Visual Studio. … | |
Hi all, I have this string "May 19, 2009 15:39:41.606809000" , i need to get the seconds into a double variable. My code is like this: [CODE]double sec; string seconds = str.substr(19,10); istringstream(seconds) >> sec; [/CODE] The thing is that seconds = 41.6068090 , but sec = 41.6068 Why doesn't … |
The End.