1,171 Posted Topics

Member Avatar for localp

>so please help me by giving me the correct code We'll never give you free code on this forum, did you read the forum rules? Let me guess...NO!! :) Some information about linked lists: [LIST] [*][URL="http://www.inversereality.org/tutorials/c++/linkedlists.html"]http://www.inversereality.org/tutorials/c++/linkedlists.html[/URL] [*][URL="http://richardbowles.tripod.com/cpp/linklist/linklist.htm"]http://richardbowles.tripod.com/cpp/linklist/linklist.htm[/URL] [*][URL="http://www.cprogramming.com/tutorial/lesson15.html"]http://www.cprogramming.com/tutorial/lesson15.html[/URL] [*][URL="http://www.eternallyconfuzzled.com/tuts/datastructures/jsw_tut_linklist.aspx"]http://www.eternallyconfuzzled.com/tuts/datastructures/jsw_tut_linklist.aspx[/URL] [/LIST]

Member Avatar for Narue
0
82
Member Avatar for BlackStar

[QUOTE=BlackStar;861174] Is there a way for the user to say, I want to go to restaurant queue 3?[/QUOTE] Yes, create an array of restaurants and access each 'restaurant' via it's subscript :)

Member Avatar for tux4life
0
124
Member Avatar for pczafer
Member Avatar for MicrosoftMahmou

What you mean is dynamic memory allocation, check out [URL="http://www.cplusplus.com/doc/tutorial/dynamic/"]this[/URL] first and feel free to ask questions if you don't understand something :)

Member Avatar for tux4life
0
98
Member Avatar for funfullson13

Is "Press ENTER to continue" also good? [CODE] cout << "Press ENTER to continue ..." << endl; cin.get(); [/CODE]

Member Avatar for funfullson13
0
111
Member Avatar for ulisse0

[QUOTE=ulisse0;862149]What? I have no idea what you are talking about.[/QUOTE] He's talking about the C++ [ICODE]fstream[/ICODE] class(es) Edit:: Sorry I misunderstood the OP's post (he was actually quoting but I didn't notice that) :(

Member Avatar for tux4life
0
163
Member Avatar for henryxxll

Did you try the [URL="http://gmplib.org/manual/"]online manual[/URL] available on it's site?

Member Avatar for Peter_APIIT
0
222
Member Avatar for bob89

Why didn't you put the end braces? [CODE]int _tmain(int argc, _TCHAR* argv[]) { cout << "Welcome to Airline Manager v1.0" << endl << endl; FlightManager fMan; [COLOR="Red"][B][COLOR="Green"]}[/COLOR][/B][/COLOR] [/CODE] [CODE] class FlightManager { public : FlightManager(); [COLOR="Red"][B][COLOR="Green"]}[/COLOR][/B][/COLOR] [/CODE]

Member Avatar for Narue
0
109
Member Avatar for ganmo

When a class has one or more pure virtual methods, the class is called an abstract class, but you cannot just create an object from it, you first have to derive a class from your abstract class and then you've to override the pure virtual methods before you can use …

Member Avatar for ArkM
0
103
Member Avatar for gr8ash

->First: Please post using code tags! ->Second: You have to know how to write manipulators :)

Member Avatar for ArkM
0
228
Member Avatar for nicolap

Actually you should check the input on being a valid integer or not :) To check whether the input is an integer or not, you could do something like this (you'll have to pass the input as a string): [CODE=C++] bool checkInt(const string &s) { int len = s.length(); for(int …

Member Avatar for vmanes
0
208
Member Avatar for lqdo

[CODE][B][COLOR="Red"]ifstream[/COLOR][/B] file; file.open( file_name.c_str(), ios::[COLOR="Red"][B]out[/B][/COLOR][B][COLOR="Red"],[/COLOR][/B] ios::binary );[/CODE] shouldn't that be: [CODE][B][COLOR="Green"]ifstream[/COLOR][/B] file; file.open( file_name.c_str(), ios::[COLOR="Green"][B]in[/B][/COLOR] [B][COLOR="Green"]|[/COLOR][/B] ios::binary );[/CODE]

Member Avatar for NathanOliver
0
131
Member Avatar for musique

Want an example of a bubble sort? Check out [URL="http://www.daniweb.com/code/snippet1177.html"]this[/URL] :)

Member Avatar for musique
0
255
Member Avatar for NathanOliver

[QUOTE=NathanOliver;860733]...and was wondering if this would work.[/QUOTE] Just compile and run it, and if there are problems: post them (and in case of an unexpected result please tell also what output you did expect) :)

Member Avatar for NathanOliver
0
107
Member Avatar for waldchr

Dev-C++ starts getting dated, use the newest MinGW-compiler(s) instead ... Edit:: Actually there comes a document with the distribution which describes the whole process ... Edit:: Look at [URL="http://wiki.allegro.cc/index.php?title=Code::Blocks"]this[/URL] link (STEP 1) to find more information on how to install the MinGW-compiler

Member Avatar for tux4life
1
641
Member Avatar for bunnyboy

> Just want to remove all the spaces from a string? >> Use a function like this one: [CODE=C++] string trim(const string &s) { string t; for(unsigned int i=0; i<s.length(); i++) if(s[i] != ' ') t+= s[i]; return t; } [/CODE] >> Just put your read expression into a string …

Member Avatar for bunnyboy
0
161
Member Avatar for pczafer

Put [CODE] cout<<endl<<"Wrong option number!! Try again\n"; cin.get(); //give the user a chance to read the output data [/CODE] in a [ICODE]do-while[/ICODE]-loop and change [ICODE]cin.get();[/ICODE] to [ICODE]cin>>option;[/ICODE] like this: [CODE] do { cout<<endl<<"Wrong option number!! Try again\n"; cin>>option; } while(option<1 || option>2); [/CODE]

Member Avatar for tux4life
0
187
Member Avatar for Sky Diploma

You could change your get_char function to: [ICODE]char get_char(int n) {return n-'0';}[/ICODE] (edit:: unless your goal is to also provide conversions from other bases) In your rev-function (see line 72) a for-statement would be better to use I think, it will also compact your code a bit :) (You can …

Member Avatar for Sky Diploma
0
547
Member Avatar for colesefini

Could you please post your code (using code tags!!) and paste the [U]exact[/U] error message(s) you're getting?

Member Avatar for tux4life
0
65
Member Avatar for frossie
Member Avatar for rahul8590
0
105
Member Avatar for timb89

Avoid the use of [ICODE]system("pause");[/ICODE] ([URL="http://www.gidnetwork.com/b-61.html"]reason[/URL]) Use [ICODE]cin.get();[/ICODE] instead :) ...

Member Avatar for timb89
0
76
Member Avatar for fadia

[ICODE]while (count=0);[/ICODE] has to be [ICODE]while (count==0);[/ICODE] If you write [ICODE]while (count=0);[/ICODE] then variable count gets assigned value 0, so this means the assignment will return zero which is equal to false with the result the while loop won't run :) ...

Member Avatar for fadia
0
163
Member Avatar for soppyhankins

[QUOTE=soppyhankins;859268]Hello again all!!! I just have two quick questions... 1.) Is it possible for one to run a program through the "system(command)" and have the output come out on top of an SDL program? Like if I had a background of some sort and typed "system(echo "Hello!")" could I have …

Member Avatar for soppyhankins
0
209
Member Avatar for mightykyle

[QUOTE=mightykyle;860193]plz help[/QUOTE] Don't be impatient, if you want fast help you should give a detailed and understandable description of what your problem is first :)

Member Avatar for mightykyle
0
198
Member Avatar for Monkey.D.Luffy
Member Avatar for Sky Diploma
0
393
Member Avatar for teddybod

[QUOTE=Frank Wallis;857009]Did you run scandisk command on your computer?[/QUOTE] In Windows XP it isn't called scandisk but [ICODE]chkdsk[/ICODE] :) ...

Member Avatar for Frank Wallis
-2
162
Member Avatar for songweaver

>Can you help me with what I am doing wrong? Sure, what's your problem? (be specific!) Are you getting unexpected output?

Member Avatar for siddhant3s
0
135
Member Avatar for cppStudent

Why are you using a [ICODE].C[/ICODE] file-extension for [ICODE]SingletonMain[/ICODE] and why a [ICODE].cpp[/ICODE] file-extension for the file [ICODE]Singleton[/ICODE] ??? I would just use [ICODE].cpp[/ICODE] for both file's extensions, as it's the most common :) ...

Member Avatar for siddhant3s
0
140
Member Avatar for slim2hott

Your code is just overkill ! I know a better one (this one has no errors :P): [URL="http://www.daniweb.com/code/snippet898.html"]http://www.daniweb.com/code/snippet898.html[/URL] :) ...

Member Avatar for NathanOliver
-2
677
Member Avatar for kkbronner

Another remark: avoid the use of [ICODE]system("pause");[/ICODE] (See [URL="http://www.gidnetwork.com/b-61.html"]http://www.gidnetwork.com/b-61.html[/URL]) You could use [ICODE]cin.get();[/ICODE] instead of [ICODE]system("pause");[/ICODE] :)

Member Avatar for NathanOliver
0
152
Member Avatar for tksrules

The first question you should ask yourself is: is it worth all the work to built in all those code to create a demo version? What's your application about, what does it do? You should also think about the following problem: If the trial/demo period has ended, the user could …

Member Avatar for Lerner
0
90
Member Avatar for SLORE

> You just copied your homework assignment and pasted it into this thread, so what's your question ? slore>If the number passed to the function is negative, the function will return the negative of the square root of the positive number. >>>>>> Actually that's not true math :P > Please …

Member Avatar for SLORE
0
106
Member Avatar for Sky Diploma

> I also need advice on converting a C++ Octal or Hexadecimal Notationed string to an integer. To do conversions between numbers and strings, [stringstreams](http://www.java2s.com/Tutorial/Cpp/0240__File-Stream/Usestringstreamtoparseanumber.htm) are often used :) Lines 28-50 can be replaced by: `return a-'0';`

Member Avatar for tux4life
0
233
Member Avatar for RayvenHawk

Avoid using system("cls") (look [URL="http://www.gidnetwork.com/b-61.html"]here[/URL] for why, the reasons are the same) :)

Member Avatar for RayvenHawk
0
188
Member Avatar for glen dc1

According to [URL="http://www.nokia.co.uk/find-products/all-phones/nokia-5800/specifications"]this[/URL] specifications it isn't ...

Member Avatar for tux4life
1
69
Member Avatar for guest7

A bad_alloc exception is thrown when dynamic memory allocation has failed, I think this is often the case when your system has not enough memory, or are you allocating to much memory ? A memory leak could be, but me eyesight is not good enough to see your program's source …

Member Avatar for drjay1627
0
116
Member Avatar for Yve2009

If you're using XP Home it might be probable that there's an administrator account without a password (called 'Administrator') Normally the password of this account is blank and you can access it by starting your computer into safe mode (press F8 just before the Windows Loading screen shows up), if …

Member Avatar for Godsp3ed
0
235
Member Avatar for Lexter25

[QUOTE=Lexter25;858344]Thanks it works!![/QUOTE] > From the comments skydiploma got on his post I read the following: "Find the bug. - Dave Sinkula" >> Now to the OP: Welcome to the world of C++: it isn't because it seems to work that it actually works :)

Member Avatar for WaltP
0
289
Member Avatar for vksmaini

> Ask specific questions about what you don't understand, all what you've done is just copied and pasted your assignment in this thread :) ... > If you want help, do some effort first, give it a try, and when you get stuck you can always ask questions ...

Member Avatar for rishabjain
0
318
Member Avatar for Sky Diploma

>For some reason the [code=c++] tag isnt working(OFFTOPIC) Did you type the word 'code' in uppercase ?

Member Avatar for tux4life
0
138
Member Avatar for agentx

> The [URL="http://www.talula.demon.co.uk/allegro/"]Allegro[/URL] Game Programming Library is definitely the way you should go ! agentx> hope u people will help me in getting those bonus marks! >> We'd like to help you with this stuff but remember that we aren't doing the coding for you, you'll have to do that …

Member Avatar for RayvenHawk
0
111
Member Avatar for skisky

Dear rahul, your code won't compile: [ICODE]student std[x];[/ICODE] is never going to work :P (edit:: unless x is a constant expression) Thats just what the OP was asking for: Dynamic Memory allocation, your code doesn't explain dynamic memory allocation I think ... Edit:: Take a look at [URL="http://www.cplusplus.com/doc/tutorial/dynamic/"]this[/URL] to get …

Member Avatar for Absaar
0
156
Member Avatar for LucyB

> I'm writing exactly the same code, but probably a bit easier to understand: >> Original posted code: [CODE] int sum=0, a=0, b=0; for (a=1;a<3;a++) for (b=1;b<5;b++) sum+=b; cout <<"sum =" <<sum; [/CODE] >> The above code is actually pretty much the same as this :): [CODE=C++] int sum=0, a=0, …

Member Avatar for rahul8590
0
111
Member Avatar for Akis2000

> First calculate the whole number where you want to take the square root from (calculate the sum of the first n elements of the series) >> Formula for the first series: (1/9)+(1/25)+(1/49)+... => [ICODE]1/((3+(n-1)*2)^2)[/ICODE] (n represents the nth element of the series :) ...) >> Formula for the second …

Member Avatar for Akis2000
0
115
Member Avatar for shasha821110

> Have you already read [URL="http://msdn.microsoft.com/en-us/library/7xcz0y39(VS.71).aspx"]this[/URL] ?

Member Avatar for MrSpigot
0
110
Member Avatar for serkan sendur

I think I've seen that book before, you don't have to take it seriously :) ...

Member Avatar for serkan sendur
-1
418
Member Avatar for ram18y

I find it great you want to share your knowledge, but for me it wasn't very helpful because of the two following reasons: -> I did already know this -> I don't use Windows Vista

Member Avatar for UrbanKhoja
0
195
Member Avatar for christiangirl

[QUOTE=christiangirl;858240]But I don't know why it is being set to [/QUOTE] > Did you actually write this code yourself? > If yes, you could try using a debugger > BTW, Avoid the use of [ICODE]system("PAUSE");[/ICODE] (look at [URL="http://www.gidnetwork.com/b-61.html"]this[/URL] excellent information written by WaltP :))

Member Avatar for christiangirl
0
134
Member Avatar for Trinimini

Instead of [ICODE]cin>>name[/ICODE] you could use [ICODE]getline(cin, name);[/ICODE] to get the first name and the surname :) ...

Member Avatar for Trinimini
0
110
Member Avatar for LucyB

> Take a look at [URL="http://www.cprogramming.com/quiz/"]this[/URL] > Try [URL="http://lmgtfy.com/?q=c%2B%2B+quiz"]this[/URL] one also :P

Member Avatar for hawash
0
106

The End.