3,892 Posted Topics
Re: [quote=bigben09;317880]ok i am having more problems. when u run the code with a number like 1234567890 it prints out 987654321 and that is fine. but if you enter something like 123456789123456789 it prints out something else. [/quote] That would be attributed to overflow i.e. trying to store a number in … | |
Re: Post your code so that we can atleast point out the mistakes you are making... | |
Re: Why not use the first ENUM set for the second selection also ? Either that or prefix the ENUM names with an abbreviation of their purpose. Something like: [code=c] enum MenuOne { MO_FIRST = 1, MO_SECOND } ; enum MenuTwo { MT_FIRST = 1, MT_SECOND } ;[/code] | |
Re: Maximum number of columns in a table or view is 1000. Read [URL="http://ora-01792.ora-code.com/"]this.[/URL] | |
Re: You are getting incorrect output since you fail to reset the attempts value to 5 again i.e. at the end of the nested do while loop, set the value of attempts again to 5. Also it is better to decrement the value of attempts at the end of the second … | |
Re: [quote=Ancient Dragon;316936]Another method is to make static all the methods and objects that the static method needs to access.[/quote] But I guess that would beat the purpose of designing class for creating objects since each object created would have the same thing inside of it (the member variables being static). | |
Re: Looks like a moderator / supermod / admin deleted that thread by mistake. | |
Re: The program looks good. Mind posting the line numbers and the exact errors you are getting. ![]() | |
Re: Since you are using C++ already, why not do something simple like: [code=cplusplus] // Not tested #include <fstream> #include <string> int main () { using namespace std ; string my_str ; const char search[] = "model=" ; size_t size = strlen (search) ; size_t pos = 0 ; ifstream in … ![]() | |
Re: Keep in mind the quote "Different tool for different tasks". You can't replace the screwdriver just because you think the hammer is cool. It also depends on why you are learning the language. Many people learn new langauges for research work. If this is the case then VB, C# and … | |
Re: Hey there eXceed, welcome to Daniweb. :D We are looking forward to overflow your knowledge base... ;) | |
Re: A simplistic way with the minimalistic error checking would be: [code=cplusplus] #include <iostream> #include <string> int main () { using namespace std ; const char allowed_chars[] = "0123456789" ; string my_var ; int num = 0 ; cout << "Enter the account number: " ; cin >> my_var ; getchar … | |
Re: Hmm.. so was it the number of round trips made to the database or a logic problem ? | |
Re: Just do:[code=c] v [2][5] = 9999 ;[/code] to insert value at a specific location in the vector. Vectors are almost like arrays except that they are a bit more robust along with a host of features. | |
Re: A algorithm for the game can be found [URL="http://www.geocities.com/stoneeeb/codes/toecode.html"]here[/URL] though not in C but still will serve its purpose of pointing you in the right direction. | |
Re: This is because you are assigning [I]p[/I] the address of a variable [I]k [/I]which is local to the function [I]changep [/I]and hence [I]k [/I]loses its existence (goes out of scope) as soon as the function exits. | |
Re: Watching TV is kind of a time killer. I agree with Infarction, even I don't seem to be needing the Idiot box... ;) | |
Re: It depends on what kind of requirement is behind the rounding but you can do something like :[code=c] x = floor (0.23) ; // 0 x = floor (0.90) ; // 0 [/code] ![]() | |
Re: [quote=joeprogrammer;314434]Except that the statement isn't in the least bit portable... Much better alternative: [code]cin.get();[/code][/quote] That not being the point since the code is already using Windows specific functions (windows.h). A good reason not to write [INLINECODE]system("pause")[/INLINECODE] would be because it spawns a seperate process and troubles the OS since its … | |
Re: Daniweb uses a sprinkling of AJAX here and there and with AJAX the back button really loses its original meaning. Try navigating the site using the drop down list at the top rather than hitting back button multiple times..... | |
Re: [quote=andy257;315813]One of my learning programs is a simple calculator.[/quote]Though doable, doing this in C or C++ requires expertise or atleast a firm understanding of the concepts. This is the very reason RAD languages like C# and VB exist, to ease the task of GUI rich application development. If you still … | |
Re: [quote=joeprogrammer;315460]As many of you probably already know, yesterday DaniWeb received a massive amount of spam threads. I want to thank the moderators for deleting all the spam; it makes me really grateful that we have them here. However would DaniWeb manage without the "flag bad post" link? ;)[/quote] Yay, I … | |
Re: [quote=happygeek;315683]You should install a cybercafe in there as well, or at the very least a WiFi hotspot and then advertise DaniWeb on the back of all tickets, membership cards, coffee mugs etc :)[/quote] Now this is what I would call imagination.... ;) BTW Miss Dani, best of luck with your … | |
Re: [quote=Tauren;314021]Haha Just expressing my feelings that's all[/quote]Different forums exist for a reason.... Thread moved to the Software developers' Lounge. | |
Re: Why try to reinvent the wheel when you can do something like.... [code=cplusplus] int main ( ) { using namespace std ; string my ; const char* const valid_char = "01" ; bool valid = true ; cout << "Please enter a string: " ; cin >> my ; getchar( … | |
Re: [URL="http://www.adrianxw.dk/SoftwareSite/Consoles/Consoles6.html"]This[/URL] would be more than enough to get you started.. | |
Re: Hello there, welcome to Daniweb... :D Oh and btw, did you say assembly...*shudders* ;) | |
Re: Hey there buddy, welcome to Daniweb.. :D Oh and btw, happy debugging... ;) | |
Re: Your last for loop is off by one -- running from 0 to 10 where it should have gone from 0 to 9. As far as sorting is concerned, something like t[URL="http://www.daniweb.com/techtalkforums/post108709-6.html"]his[/URL] might be worth reading to see if it serves your purpose.... | |
Re: Either using : [code=c] const char* ptr = param ; // or char* ptr = const_cast<char*> (param) ; [/code] But it would be interesting to know what you are trying to achieve here..... | |
Re: It seems that you have declared searchnum as a C style string or a null terminated string. If you want to compare C style strings, you can't do it using the not equal to operator. You need to use the function [search]strcmp[/search] function which returns 0 when the two strings … | |
Re: Show some effort on your part by pasting the code you have so far got here... | |
Re: Hmmm...have heard that some generous and kind person who goes by the name of Blud is giving out free copies of Vista. Hey there buddy, how are you, hope you are doing fine...nowwww, where is my copy of Vista ;) | |
Re: Since you are calling the function of the object (ie the member function) you don't need to pass anything to the function, since the object contains all that is needed to sort its elements. Just don't forget to update the length of the internal list and it should be fine. … | |
Re: Nice one, though would be a nightmare for those who have vision problems.... | |
Re: From the poll 90% of the people who have voted think that Valentine day sucks big time.... | |
Re: Just a minor point, better use ++variable instead of using variable++. If done so prevents the creation of a temporary variable. This is a normal hack used by all programmers. • Pre-increment(++a) - Increment the value of variable and then use it. • Post-increment (a++) - Use the value of … | |
Re: ....except that changing the language is not the topic under discussion here. Btw there is a plethora of interpreted / compiled langauges out there which provide the same ease of use, so I guess Ruby isn't that spectacular after all.... | |
Re: @Aia You really need to cut down the commenting a bit -- its overwhelming. With practice you will surely come to know when the documentation is getting out of hand -- your code is almost 50 % documentation and that too sprinkled throughout the code which makes it difficult to … | |
Re: [quote=joeprogrammer;311378]The new line numbers inserted when using syntax coloring code tags is causing me problems when copying and pasting code. [/quote] Click on the link "toggle plain text" which appears below the code snippet and then try copy-pasting. It works out to be fine. | |
Re: Maybe [URL="http://www.daniweb.com/techtalkforums/post311548-4.html"]this[/URL] would interest you... | |
Re: [quote=Tauren;312644]Why thankyou joe! And colleges anyone know for art texturing!?[/quote] [URL="http://www.digipen.edu/"]This[/URL] and [URL="http://guildhall.smu.edu/"]this[/URL]. | |
Re: Hello there girly, welcome to Daniweb.. :D If you have a lot to learn, we have to lot to share.... ;) | |
Re: Hello my friend, I have requested this thread to be moved to the appropriate forum so that you can get maximum help. And btw, welcome to Daniweb. :D | |
Re: Welcome to Daniweb my friend :D You will find a lot of people of your age here....;) |
The End.