581 Posted Topics

Member Avatar for gctarzana

I think that you can use a pointer and acess member variables using the '->' Operator. And instead of a single delete. in your destructor. I think we can use something like [code] delete [] Pi; [/code] In the Inventory Class destructor.

Member Avatar for Sky Diploma
0
2K
Member Avatar for daniel88

Hey Interesting Questions above. But i was wondering how do i do that polymorphic structs for this question, [QUOTE]Write a Structure named BASE_STRUCT and another structure named DERIVED_STRUCT where DERIVED_STRUCT is a polymorphic object that inherits information from BASE_STRUCT"[/QUOTE] Should we actually write a constructor For Base_struct and then write …

Member Avatar for hammerhead
0
290
Member Avatar for Black Magic

Correct me if i am wrong . But after entering the ID isnt it necessary for the program to find the matching case for the user input? I mean there isnt any function in the above program which is searching for a particular id.

Member Avatar for Sky Diploma
0
110
Member Avatar for mariaczi_pl

Just remove "Void" from all of your functions. [code] CCenter::~CCenter(void) { } [/code] change it to [code] CCenter::~CCenter() { } [/code] And try if it works.

Member Avatar for mariaczi_pl
0
192
Member Avatar for kartik14

Does extern "c" work only for C Codes. This is because i read in a book that with extern "c" we can export many codes from Many Languages.

Member Avatar for vijayan121
0
147
Member Avatar for fans3267

Dude just post the code that you have worked on and are having mistakes, We can then help you, Daniweb isnt a homework service. You will need to show some effort.

Member Avatar for Nick Evan
0
299
Member Avatar for &rea

I am not an expert but i am trying to learn . I dont understand something in the program. &rea 's code [code]unsigned int* RegionToArray(System::Drawing::Bitmap^ binaryImage,unsigned int coordinate_x, unsigned int coordinate_y, unsigned int width_rect, unsigned int height_rect){ [/code] [code] coordinate_x=this->coordinate_x; coordinate_y=this->coordinate_y; width_rect=this->width_rect; height_rect=this->height_rect; [/code] Well If the function is a …

Member Avatar for Duoas
0
169
Member Avatar for kllera

Try Something Like This. First Considering that your double is named x; [code] int absx=abs(x); double remainder=x-absx; [/code] then use the modulus operator with absx. Something like [code] double answer=absx%some number; [/code] Then Add in your remainder value [code] answer+=remainder; [/code] So you wont loose your decimal points using this.

Member Avatar for Radical Edward
0
190
Member Avatar for grommet2481

Hey I have never tried what is posted below. But i think it might work out fine if you wish to align. After the ID 01 And then you can give out a fixed length of setw(4); After that when it comes to the NAME part maybe we can give …

Member Avatar for Sky Diploma
0
92
Member Avatar for ambarisha.kn

Well start out writing the program framework. and next you can ask where you need help.

Member Avatar for ithelp
0
95
Member Avatar for Run.[it]

Hey Just use the return Statement to Exit. and in the switch statments Add the following. So the program returns a value and ends. [code] case 0: return 0; break; [/code]

Member Avatar for Run.[it]
0
143
Member Avatar for agodislife

There are many errors in your code. To start with . All Function Declarations and Global Variables Should not be declared inside main. The have to be declared outside any code block. Secondly , You have different sets of variables. Like in one line you have used. [code] Gross_Pay=; [/code] …

Member Avatar for Sky Diploma
0
88
Member Avatar for Sky Diploma

Help Me with this code. i JUST installed code::Blocks and am not familiar with the errors , I wanted to know what is going wrong with this? [CODE=CPLUSPLUS] #include <iostream> using namespace std; int f(); class Date{ int d,m,y; static Date default_date; public: void set_default(int dd,int mm,int yy); Date(int,int,int); Date& …

Member Avatar for Sky Diploma
0
148
Member Avatar for cobaltbass

You can also use Character Arrays [code] char title[30]; cin.getline(title,30); [/code] This will even take in spaces between words too.

Member Avatar for Nick Evan
0
111
Member Avatar for xyinyangx

You can use a set of function calls for each room. I have changed in some segments of your code and written a function room1(); you can do that for all your six rooms such that the program will run until the game ends. You can however keep a quit …

Member Avatar for xyinyangx
0
763
Member Avatar for sash007

Well , There is another solution which is simple but requires somewhat more code. But it is sure easy. It is quite easy and i think any programmer of minimum experience will be able to conclude it out. So Okay here it goes. [LIST] [*][B][U]Instructions :[/U][/B] [*]Okay First You Need …

Member Avatar for sash007
0
134
Member Avatar for Beemer

[code=cpp] #include <iostream> using namespace std; float bursary(int noModsPassed07 ,int noModsReg08) { if (noModsPassed07 = 0) return 0; if (noModsPassed07 >0 && noModsPassed07 <= 2 && noModsReg08 >= 1) return 300; else return (noModsPassed07 + noModsReg08 * 100); } int main() { int noModsPassed07, noModsReg08; float burs; cout << "Enter …

Member Avatar for Salem
0
103
Member Avatar for usmanabb

Dude Post in some of the code and then be specific in the questioning . This looks like you are trying to get the homework done totally by the members. >>It probably has many if conditions, but how many is the Question?? This basically depends upon the programmer. For example. …

Member Avatar for usmanabb
0
721
Member Avatar for EngSara

[url]http://www.embedded.com/news/embeddedindustry/192501421?cid=RSSfeed_embedded_news&_requestid=245414[/url] I dont know much about Verilog But above is a n article about it. Hope it helps you out.

Member Avatar for Sky Diploma
0
84
Member Avatar for Sky Diploma

Hi Everyone , I have some doubts which i have encounteered when i was working on a project of mine, 1)I was wondering whether system("sky.exe") could have variables in it. can i use a string in the place of "sky.exe" something like this [code] string s; s="sky.exe"; system(s); [/CODE] 2) …

Member Avatar for Sky Diploma
0
146
Member Avatar for Metalsiege

just add [code] Pause(); [/code] into the code where ever you want to stop . And copy and paste the function somewhere outside main(); And it will work fine.

Member Avatar for Metalsiege
0
203
Member Avatar for gps
Re: c++

Google for books and tutorials. Buy them or take the free one's C++ Will take time but the effort will be worth it :)

Member Avatar for Sky Diploma
0
51
Member Avatar for shinpad

Other than that you can use this with shorter code. [code] cout<< "Is the user scheduled for work today? (Y/N)"/n; cin>> ScheduledIn; ScheduledIn = toupper(ScheduledIn) while((ScheduledIn !='Y' || ScheduledIn != 'N')) { cout<< "Please enter Either Y OR N"; cout<< "Is the user scheduled for work today? (Y/N)"/n; cin>> ScheduledIn; …

Member Avatar for Nick Evan
0
126
Member Avatar for Dannyo329

[QUOTE=Dannyo329;604592]Hey Everyone. Is there any way to make a sub? For example there's int main(), can I make something else like int menu() and sort of link int main to int menu? I have no idea how to do this.:-/[/QUOTE] Well if you wanna make subs as you call them …

Member Avatar for Laiq Ahmed
0
162
Member Avatar for knowledgelover

You can use a converter to convert the code from c# to c++ but i have seen one which is costly . [url]http://tangiblesoftwaresolutions.com/Product_Details/Instant_CPlusPlus_CSharp_Edition.htm[/url] I just searched it out on the net. But donot have much knowledge about it.

Member Avatar for mitrmkar
0
394
Member Avatar for gazoo

Once you get the year. Look if the remainder when divided by 4 is zero. if(yyyy%4=0) { then //code for leap year; } else{ //code for normal years. Secondly. Instead of checking between 1 to 31 . You should check for values between 1 and the number of days. Something …

Member Avatar for tesuji
0
894
Member Avatar for ro4782
Member Avatar for William Hemsworth
0
101
Member Avatar for paradox814

Isnt it working with *root=n;// As this is a normal code for pointing to a variable?

Member Avatar for bugmenot
0
279
Member Avatar for daniel88

I dont think you can grow the size of an array in run-time using normal variables. It basically needs vectors to do that. Correct me if i am wrong.

Member Avatar for Radical Edward
0
137
Member Avatar for Black Magic

Well cin.getline()....... this function needs two inputs. 1 ) Name of the variable and it is taking only char types not strings. . 2 ) How many characters to get. Read More on this over here. [url]http://www.cplusplus.com/reference/iostream/istream/getline.html[/url]

Member Avatar for Nick Evan
0
138
Member Avatar for Spagett912

>>C[Warning] `displayStatus' initialized and declared `extern' In the header file you donot have any comma's where as in the file display.cpp you have two inputs for the function maybe that is the reason for that.

Member Avatar for joshmo
0
153
Member Avatar for manzoor

[QUOTE=Salem;604268]It means they're allocated by the compiler when you compile the program, not when you run the program.[/QUOTE] Yes, Consider this example [code] #include <iostream> using namespace std; int main() { int numbers[5];//This is a fixed array of 5 memory slots. cout<< "Enter A Number"; cin >> numbers[0];//Filled Number 1 …

Member Avatar for Sky Diploma
0
847
Member Avatar for GigaCorp

The Right hand value over here in [code] patientstruct1= (*patientstructpointer); [/code] Is an error because a the stucture is taking in values from a pointer, which is not allowed. An example program is written below so that it may help you in solving your problem [code=cplusplus] #include <iostream> using namespace …

Member Avatar for GigaCorp
0
159
Member Avatar for Jennifer84

Well do you mean the end of the c++ program or the end of "file.txt" as you have mentioned in the program?

Member Avatar for Jennifer84
0
274
Member Avatar for xlx16
Member Avatar for yureika
Member Avatar for Sky Diploma
0
43
Member Avatar for dwlamb_001

Try a search on google on CSS Liquid Layouts. I do not have much idea about that. But it is possible.

Member Avatar for dwlamb_001
0
130
Member Avatar for Motvel

[QUOTE=sacdpathade;599980]hey , Prabhakar's qoute is right. Let me elaborate this solution for you. I think to calculate nearest point, u should take following approach. Lets assume that you have 3 points (x1,y1)(x2,y2)(x3,y3). Now you have a point (X,Y) from which you have to search nearest point from mentioned 3 points. …

Member Avatar for dmanw100
0
122
Member Avatar for CodeBoy101

Well thats pretty easy. Use the library cctype [CODE]#include <cctype>[/CODE] And then you can use the tolower command. It just is opposite of toupper. [CODE]char c; cin>>c; char d=tolower(c); cout<<d; [/CODE] Then that code takes in a character and converts into lowercase.

Member Avatar for Radical Edward
0
112
Member Avatar for zidaneqrro

Well the program firsts calls main(); Then after that, Assigns space for 3 variables. Then takes 2 values into the first two of its variables and then looks at difference=Subtract(a,b); During that it first calls the function Subtract(a,b) And then assigns the output value to the variable difference. But Subtract …

Member Avatar for Sky Diploma
0
83
Member Avatar for zidaneqrro

As for the compiler. You can use DEV'S C++ compiler. That is a good one and it avoids command line compiling.

Member Avatar for osirus0830
0
120
Member Avatar for loeto

Secondly . [B]LOETO[/B] I think you should remove [CODE]cin >> number,first,second,third,fourth;[/CODE] Or [CODE]cin >> number>>first>>second>>third>>fourth;[/CODE] And just use the [CODE]cin>>number;[/CODE] As YOU only require to take in one number each time and get the first,second,third and fourth out from the main number.

Member Avatar for loeto
0
161
Member Avatar for complexcodes
Member Avatar for bugmenot
0
100
Member Avatar for Black Magic

Hey Black Magic i have solved your problem. Well just examine That you have typed this code in [CODE]p1hp -= p2attack;[/CODE] Line 54. Which probarbly doesnt get executed because there are break; statements above it. So You actually need to paste the code in between Line 46 and line 47 …

Member Avatar for Sky Diploma
0
164
Member Avatar for marti3a3

Well I guess if you can define Cool outside main , And as a GLOBAL var is. The problem will be solved. So try defining Cool outside main . or any other function So that it becomes global. Hope that works ;)

Member Avatar for marti3a3
0
151
Member Avatar for spuddy1515

Well all C-based compilers have to add in the headers with '.h' following them. Later after the formation of c++ the programmers have ruled out the usage of '.h' and added c in the begininning So #include <ctime> or #include <time.h> Refers to a header file with same content in …

Member Avatar for spuddy1515
0
526
Member Avatar for Aamit

Try Googleing it out. Or try on WIKIing it out then you will get a good idea abt it.

Member Avatar for Asat232
0
232
Member Avatar for dinozulf
Re: C++

Well if you can compress it up into a .zip file then you can directly post it up on the forum .While replying to the thread ;)

Member Avatar for Sky Diploma
0
78
Member Avatar for mussa187

Well you have just left in the question but dint post out any code that we could help you with. This forum is not a homework service. [url]http://www.daniweb.com/forums/announcement8-2.html[/url] Read the above page and then ask questions.:)

Member Avatar for mussa187
0
129
Member Avatar for anerchy

What actually is happening is that. You have created 2 arrays with the same name in two different functions. So in main the values are getting assigned to the values in the array in line 30 ; And the values that are being printed are from the array which is …

Member Avatar for anerchy
0
105

The End.