49,757 Topics

Member Avatar for
Member Avatar for Syrne

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 …

Member Avatar for Syrne
0
181
Member Avatar for globberbob

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 …

Member Avatar for globberbob
0
178
Member Avatar for boss the robo
Member Avatar for eagles39

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> …

Member Avatar for Taywin
0
2K
Member Avatar for raider650

[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 …

Member Avatar for Taywin
0
97
Member Avatar for Meterior

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 …

Member Avatar for Meterior
0
92
Member Avatar for tauqeerahmed

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]

Member Avatar for tkud
-1
59
Member Avatar for ggyyree

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 …

Member Avatar for Fbody
0
560
Member Avatar for massivefermion

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 …

Member Avatar for SasseMan
0
317
Member Avatar for triumphost

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 …

Member Avatar for Ancient Dragon
0
210
Member Avatar for Nemo_NIIT

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=&quot;false&quot; 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(&quot;The string TCHAR* …

Member Avatar for Ancient Dragon
0
289
Member Avatar for vinnieashken

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() { …

Member Avatar for Ancient Dragon
0
32
Member Avatar for jjspikejones
Member Avatar for ccube921

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 !== …

Member Avatar for frogboy77
0
171
Member Avatar for merse

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 …

Member Avatar for merse
0
369
Member Avatar for krnekhelesh

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?

Member Avatar for soltanmahmoud
0
438
Member Avatar for htataw

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> …

Member Avatar for pramudiyanto
0
723
Member Avatar for wmc++

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 …

Member Avatar for mrnutty
0
583
Member Avatar for jmcorpse

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 …

Member Avatar for jmcorpse
0
270
Member Avatar for Tecnicrow

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 …

Member Avatar for Tecnicrow
0
591
Member Avatar for mushahidh

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..

Member Avatar for jonsca
0
3K
Member Avatar for jwill222

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 …

Member Avatar for jwill222
0
4K
Member Avatar for frogboy77

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 …

Member Avatar for frogboy77
0
122
Member Avatar for SolidSora

[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 …

Member Avatar for SolidSora
0
89
Member Avatar for Robbiedoes

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 …

Member Avatar for StuXYZ
0
203
Member Avatar for anthonys1mom

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 …

Member Avatar for Lerner
0
17K
Member Avatar for tech9x

[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 = …

Member Avatar for WaltP
0
116
Member Avatar for volc90

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 …

Member Avatar for Lerner
0
128
Member Avatar for IMJS

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. …

Member Avatar for IMJS
0
324
Member Avatar for Feim

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 …

Member Avatar for Feim
0
130

The End.