1,362 Posted Topics

Member Avatar for seakayaker

If they are member variables of the class, they are not global. They are, as you note, accessible to all functions of the class. However, they are accessible only within a given instance of the class. If you have a variable temperature in class World, and you have multiple worlds …

Member Avatar for seakayaker
0
166
Member Avatar for vmanes
Member Avatar for ellimist14

You could start by reading [URL="http://www.daniweb.com/forums/thread215615.html"]this very similar thread[/URL], which at this writing is right above yours.

Member Avatar for vmanes
0
78
Member Avatar for gretty
Member Avatar for umarmaqsood

You can write Windows programs (or GUI programs for Linux or Mac) in C++ (or C). It requires more than what you probably find in the basic C++ book - you have to use the GUI's API (application programming interface) - those are functions that directly interact with the windowing …

Member Avatar for Nick Evan
0
340
Member Avatar for DdoubleD

To turn on automatic indenting of blocks Tools | Options | Text Editor | C/C++ | Tabs select Smart Indenting

Member Avatar for DdoubleD
0
143
Member Avatar for muzhe

Yes, you need to clearly describe what you're trying to do. A - are you storing the z value at each and every x,y coordinate? Such as, elevations at geographic positions. If so, you can really treat this as a 2D problem, where the data stored at each x,y cell …

Member Avatar for muzhe
0
169
Member Avatar for scantraXx-

If the code above is in a loop, where you ask for a new word to seek, your problem is that the file is left pointing past its end. Unless you do [code] dict.close( ); dict.clear( ); [/code] before you open the file again, you will not be rereading the …

Member Avatar for tux4life
0
195
Member Avatar for MktgRob

I was just about to post a link to that video, and ask if people thought it too graphic and grisly. Personally, I think this should be seen by every last person that has a cell phone - teen or adult, driver or not. There is no communication or message …

Member Avatar for vmanes
0
121
Member Avatar for kernel>panic

if your file looks just like the example you give, why not read each line into separate strings. If the second string has the value you interpret as activated, then use the password found in the first.

Member Avatar for kernel>panic
0
184
Member Avatar for gopi17

Declaring the array as you're trying to do, you MUST declare the sizes of the row and column dimensions*. To allow the user to enter the size at runtime, you'll have to use dynamically allocated array, that is, pointers. Generally speaking, this is the pattern: [code] int **game ; int …

Member Avatar for mrnutty
0
163
Member Avatar for poliet

A static data member? [code] class foo { private: static bool vis; char ch; public: void change_vis() { vis = !vis ;} //other member functions }; bool foo::vis = true; //initialize the member [/code] or [code] class foo { private: static bool vis; char ch; friend void change_vis(foo &a ); …

Member Avatar for poliet
0
85
Member Avatar for JameB

You need to join the modes with bitwise OR ( | ), not as comma separated parameters. [code] myfile.open( "myfile.txt", ios::app | ios::in | ios::out ); [/code] Opening with append mode will not allow you to overwrite the file content, all you can do is add to the end. If …

Member Avatar for vmanes
0
129
Member Avatar for jko2326

As long as you are guaranteed that the item names will be only one word, this is not a hard problem. Your numeric data items should be type int, with the item name being a char array, as you have. Your reading line stays as you have it. From the …

Member Avatar for poncho4all
0
421
Member Avatar for neppy

Hijacking threads is not looked upon kindly - start your own for a new topic. Read the announcements - we won't do your homework for you. If you tell us which answer you think is correct, and explain your reasoning, we'll be more inclined to help.

Member Avatar for neha arora
0
106
Member Avatar for cougarclaws

[QUOTE=firstPerson;949951]I think this is supposed to be a recursive pow() function.[/QUOTE] Nope, it another commonly used function. Step through it. One way you might examine what's happening, and get an understanding of recursion, is to get a bunch of small pieces of paper. Use a piece for each recursive call. …

Member Avatar for cougarclaws
0
111
Member Avatar for prodigyaj

Use type [icode]double[/icode] instead. This will give you about 15 digits precision, compared to a float's 7 digits. And an alternative to the formatting: [code] cout.precision(10); //substitute the # digits you want after decimal cout << fixed << showpoint; cout << pow( f, n ); [/code]

Member Avatar for vmanes
0
123
Member Avatar for Vermillion

[code] for(int i = 0; i <= Flowers; i++){ Flowers[i] = i + 1; [/code] Don't you mean [icode]FlowersInHeap[i][/icode] here? And, the big problem, is using <= as the test comparison. For Flowers = 5, you are trying to access elements 0 through 5, which is a total of 6 …

Member Avatar for mrnutty
0
1K
Member Avatar for ryno365

keywords "private" and "public" must be all lowercase. You're throwing the compiler for a loop before you get anywhere. Also, right off the the top, your getname( ) function must have return type of string, not int.

Member Avatar for ryno365
0
113
Member Avatar for agaba

When you set up the project, you need to select "Win32 Console app", not "Win32 app"

Member Avatar for agaba
0
282
Member Avatar for liveonfire

It depends on the size and complexity of program you're trying to write. If it's a small program and the validation is short and simple, it would not be wrong to check the arguments in main( ). If the testing was more complex, you could pass the argc and argv …

Member Avatar for liveonfire
0
81
Member Avatar for gopi17

[icode](rand()%4)+1[/icode] can only give you values from 1 to 4, so you're going to have duplicates, possibly several of the same. To get unique values, at each assignment you have to examine the previously chosen numbers and reject any duplications as you create them. Frankly, giving an assignment like this …

Member Avatar for wildgoose
0
222
Member Avatar for yellowSnow
Member Avatar for helixkod

Yes, you must use a constant value in your array declaration. Recent change to C language allows use of a variable size, and "some" C++ compiler(s) now accept that usage, but it's not standard for C++ yet. Using the values found as the index of the counting array is bound …

Member Avatar for supergeek60
0
201
Member Avatar for Hiroshe

A C-130 that went from 25,000 feet to parked on the ramp in 5 minutes. Pilot was late for a hot date, I think.

Member Avatar for sknake
0
187
Member Avatar for almostbob

That's right up there with the continual exhortations to "do more with less." Eventually, we can do absolutely everything with absolutely nothing.

Member Avatar for GrimJack
0
159
Member Avatar for iamsmooth

fin.getline( message, MESSAGE_SIZE, '\0' ); -or- getline( fin, message, '\0' ); These cause the input to read till a NULL is encountered, which should never happen. Thus, it will read till end of file, storing all to the single string variable. The newlines in the input file will be preserved …

Member Avatar for iamsmooth
0
97
Member Avatar for ditz

[quote]...have a giggle at someone else's expense ...[/quote] see: US Congress

Member Avatar for shadwickman
1
161
Member Avatar for tiger86

What might be a valid message goes by so fast, the viewer is lost. I will agree with you that some green regulation often goes through without full thought of the consequences.

Member Avatar for radioads
0
176
Member Avatar for The Dude

Or besides getting delayed (4 days last trip I took) or just plain lost (does it go to the same place as odd mittens and socks?), the airline gorillas could just simply [URL="http://www.youtube.com/watch?v=5YGc4zOqozo"]break your stuff[/URL].

Member Avatar for The Dude
0
130
Member Avatar for CoolGamer48

You probably need to follow the steps in these [URL="http://msdn2.microsoft.com/en-us/express/aa700755.aspx"]instructions [/URL] for setting up the Windows SDK in VC++Epress 2005 - telling VC where to find the includes and libs and executables.

Member Avatar for Sepiantum
0
496
Member Avatar for san_sarangkar

10 seconds with google finds [URL="http://gethelp.devx.com/techtips/cpp_pro/10min/10min0400.asp"]this[/URL] But, I would not put the [icode]<< endl[/icode] in the overload - that limits how you can use it in building up outputs from multiple object.

Member Avatar for Tom Gunn
0
148
Member Avatar for sfgal

It would help to also see sample of how your data is formatted in the file. I'm assuming it's something like: album name 1 song 1 song 2 song 3 === album name 2 song 1 song 2 song 3 === album name 3 song 1 song 2 song 3 …

Member Avatar for Ancient Dragon
0
91
Member Avatar for TheSwagger

There is seldom, if ever, the need to use exit( ) other than for some abnormal ending. If your program runs correctly and completely, the return(0) at the end of main( ) will cause the program to gracefully end. You have the char "oper" and the string "op" which both …

Member Avatar for TheSwagger
0
65
Member Avatar for darkzero89

Big thing is you're not storing all the input file [code] while(getline(fs, line)) { cout << line << endl; } [/code] reads a line from file, storing to string "line". Then it reads next line from file, overwriting whatever was in "line". So you'll only have the last line of …

Member Avatar for darkzero89
0
276
Member Avatar for mrgreen108

Perhaps a success/failure indicator? Are you to provide negative results if Y is larger value than X, or should the operation not proceed in that case? In other words, is the value in Z to be considered a valid result or not.

Member Avatar for vmanes
0
198
Member Avatar for Flyin dagger

He promised us Change. He begins that by stacking his cabinet and senior positions with recycled Clinton era political hacks. Turning the [URL="http://www.foxnews.com/politics/2009/02/03/obama-getting-heat-for-turning-up-thermostat/"]Oval Office into a tropical greenhouse[/URL], as he tells us we must cut back on energy usage. Q: How do you get a Democrat politician to pay all …

Member Avatar for Aia
0
783
Member Avatar for jessejamesjjr

9 posts and you can't find the correct forum? Your code is C, not C++. That said, your logic is generally correct. I would not expect you to put the text in the output file, just the values. In computing the average, remember that integer division gives an integer result …

Member Avatar for wildgoose
0
175
Member Avatar for MosaicFuneral
Member Avatar for amrith92

[QUOTE=Ancient Dragon;874761]We have a lot of ghosts here in St Louis -- they even vote every election year :)[/QUOTE] I thought that was mostly a Chicago thing. I think the ghosts of my cats that have passed on come back to annoy the cats that are still here. Every now …

Member Avatar for jephthah
1
347
Member Avatar for GrimJack
Member Avatar for Sky Diploma
0
116
Member Avatar for scru

[QUOTE=EnderX;548188] My preference, frankly, is for 'Southern', not because of the accent, but because, with the (mostly)death of Middle English, this dialect is the only version of English which remains (to my knowledge, at least) to bear the distinction between the singular and plural forms of the second person. (Although …

Member Avatar for jbennet
0
332
Member Avatar for matt4615

you will have to implement some means of checking the numbers already assigned to a row. either iterate through the numbers already picked, and if any match the new number, discard it and generate a new one. Or, a bit quicker, set up an array of size 40 (or 41), …

Member Avatar for VernonDozier
0
846
Member Avatar for nakemaro

[QUOTE=nakemaro;890422]but the teacher told us that she there is way ro do that becouse she has plenty of project so she doesn't want to copy and past everytime thanx ^^[/QUOTE] Well, then the teacher should give you instructions on how to set up the project. Not sure if it will …

Member Avatar for nakemaro
0
200
Member Avatar for djm123

Control Panel | System Or right-click My Computer, Properties, System Restore tab

Member Avatar for caperjack
0
121
Member Avatar for vmanes

[URL="http://gizmodo.com/5111630/"]Gel Remote Control from Panasonic.[/URL]

Member Avatar for vegaseat
0
112
Member Avatar for chaines51

Stated that way, it its a bit of a confusing thing. But, your second question can help put it into perspective. I'm assuming a and b are pointers to arrays of some type. The * would dereference the pointers, giving you the values pointed to. So the value b points …

Member Avatar for vmanes
0
113
Member Avatar for GrimJack

Nice drive, done it from your area to my home in Rapid City several times the last few years. This list should get you across to WI [url]http://511.idaho.gov/default.asp?display=allAdvisories&area=&textOnly=[/url] [url]http://www.mdt.mt.gov/travinfo/[/url] [url]http://www.wyoroad.info/[/url] [url]http://www.sddot.com/511.asp[/url] [url]http://www.511mn.org/[/url] [url]http://www.511wi.gov/Web/[/url]

Member Avatar for GrimJack
0
66
Member Avatar for guest7

Perhaps you mean you have to include the path to the binaries/libs/includes for your compiler? We'll need to know what compiler/IDE you're using to give you good instruction.

Member Avatar for guest7
0
108
Member Avatar for jonow

[URL="http://www.youtube.com/watch?v=tGvHNNOLnCk"]Steve Ballmer selling Win 1.0[/URL]

Member Avatar for tux4life
0
350

The End.