3,892 Posted Topics
Re: Hello Sophie, welcome to Daniweb. :D Good to see a game phrogrammer here... ;) | |
Re: Something like[URL="http://www.cs.plu.edu/%7Edwolff/svn-tutorial/svn-tutorial.html"] this[/URL] ? | |
Re: You should try out something like [URL="http://www.codeguru.com/forum/showthread.php?t=300530"]this[/URL] though you should know in advance that it would quickly turn out to be ugly in case you don't have the required knowledge of C++/WinAPI. | |
Re: Here is formatted code: [code=cplusplus] #include <iostream> #include<iomanip> #include<string> using namespace std; struct DaysStruct { int month; int st_date; int end_date; DaysStruct(int i,int e) { st_date = i; end_date = e; } } ; struct BaseStruct { int date; int end_date; double snow_depth; } ;//Function prototypes void calcDays(DaysStruct[],BaseStruct[],int); void sortbyBase(BaseStruct[],int); … | |
Re: Vista comes with DirectX 10. [quote]There are some issues for software developers using some of the graphics APIs in Vista. Games or programs which are built on Vista's version of [URL="http://en.wikipedia.org/wiki/DirectX"]DirectX[/URL], 10, will not work on prior versions of Windows, as DirectX 10 is not backwards-compatible with DirectX 9.[/quote] Read … | |
Re: [URL="http://www.idevelopment.info/data/Programming/java/collections/ArrayListExample.java"]ArrayList example.[/URL] | |
Re: [quote=FoX_;345208] [code] a = (int **)malloc([COLOR=Red]sizeof(int)[/COLOR] * 10); for(x = 0; x < 10; x ++) { a[x] = (int *)malloc(sizeof(int) * 3); } [/code] [/quote] In this case you were lucky enough to have the size of integer the same as the size of a pointer. If it would … | |
Re: ...and do a favour to the members of this forum by posting code in code tags. :D | |
Re: [quote=cbailey3001;345096][code] [COLOR=#800080][/COLOR][COLOR=#800080]public [/COLOR][COLOR=#800080]void[/COLOR][COLOR=#000000] run() { [/COLOR] [COLOR=#800080]for[/COLOR][COLOR=#000000] ([/COLOR][COLOR=#800080]int[/COLOR][COLOR=#000000] i = 1; i >= 1; i++) {[/COLOR] [COLOR=#000000]System.out.println([/COLOR][COLOR=#00ff00]"Thread "[/COLOR][COLOR=#000000] + getName() + i);[/COLOR] [COLOR=#000000]}[/COLOR][/code][/quote] What is the for loop supposed to do? For all I can see, it gets executed only once. Is this what you wanted? Maybe an infinite while … | |
Re: Something like this? [code=java] public class Test { public static void main (String[] args) { String str = "HellO THIS is @#@%@ a M*#ED string"; int length = str.length(); int upperCount = 0; int lowerCount = 0; int punctCount = 0; int digitCount = 0; int whiteSpaceCount = 0; char … | |
Re: < intends on stealing the plot since even I have the same ranks to climb > ;-) | |
Re: See [URL="http://www.cplusplus.com/doc/tutorial/namespaces.html"]this[/URL] for namespaces. For difference between <iostream> and <iostream.h> see [URL="http://www.devx.com/tips/Tip/14447"]this.[/URL] | |
Re: You have an extra semicolon ( ; ) somewhere in your code. Since C++ (and many other languages) treat it as a blank or no processing statement, your compiler is throwing you out that warning. Remove the extra semicolon and you should be fine. | |
Re: > why posting games suck Because people evaluating them like the word "suck".... | |
Re: Make the member variables of the class as normal variables instead of pointers and you should be good to go. And btw, its not a good idea to make the member variables as private since it voilates the OO practices. Write getters and setters and make your data members as … | |
Re: You need to trim the string accepted from the file. Use something like this: [code=cplusplus] #include <iostream.h> #include <string> using namespace std; string trimLeft(const string &value) { string::size_type where = value.find_first_not_of(' '); if (where == string::npos) // string has nothing but space return string(); if (where == 0) // string … | |
Re: All these things exist out there, its just that in this particular case, they were exposed to the people. Yes, I sometimes really wonder what the world is coming to... | |
Re: > Assembly language. Except for the fact that this is a C/C++ forum... | |
| |
Re: No such error in my case. Which compiler are you using ? Just a thought, try keeping different variable names for the GOTO labels and your normal variables and see if that makes a difference. | |
Re: If you want IDE's specifically aimed for C++, you can read [URL="http://www.daniweb.com/techtalkforums/post234971-1.html"]this[/URL]. Oh and btw, conio.h is not a standard header, so no point in searching for one. | |
Re: Another approach would be : [code=sql] delete from TABLE_NAME T where rowid not in (select max(rowid) from TABLE_NAME R where R.common_column = T.common_column;) ; [/code] Here common_column is the criteria for filtering out duplicates. | |
Re: Does this occur for specific values of size ? If yes, which compiler are you using ? Also post the relevant code.. | |
Re: [URL="http://www.cppreference.com/index.html"]This[/URL] and [URL="http://www.cplusplus.com/reference/"]this.[/URL] | |
Re: [URL="http://www.cplusplus.com/reference/clibrary/cstdio/getchar.html"]getchar()[/URL] | |
Re: Heh really an interesting thread...From a "beginner asking for advice" to "I will definately take revenge"...Oh, what has this world come to... :D | |
Re: Your logic is completely broken and your code does not compile on a modern compiler. I can bet you are using Turbo C. The reason your program crashes is because you are trying to write on memory which doesn't belong to you. Output in my case: [QUOTE]this program doesn't work … ![]() | |
Re: [quote=wujianwei;341320]I have been wondering the definition... I mean, Are both 00123 and 12345 five-digit numbers?[/quote] If talking in context of programming languages (C/C++), [B][I]no[/I][/B]. A number with leading 0 denotes an octal number the same way that a leading 0X denotes a hexadecimal number. So in the end, when expressed … | |
Re: [quote=naya22;341340] [I][B]Remember:[/B][/I] If you give a man a fish you feed him for a day. If you teach a man to fish, you feed him for a lifetime.[/quote] A nobel thought, but please look at the date of the last post before posting. You just resurrected a year old thread... … | |
Re: That would be silent and notorious [URL="http://en.wikipedia.org/wiki/Buffer_overflow"]buffer overflows[/URL] you are talking about... | |
Re: [URL="http://en.wikipedia.org/wiki/Prime_number"]Full defination of prime number.[/URL] | |
Re: Or use a smart IDE which will interpolate TAB with spaces...That way you can use tabbing in your program and be rest assured that the formatting won't be messed up since that tab would actually be spaces. PS: Long time no see Niek...;) ![]() | |
Re: [quote=WaltP;340597]It is fine to use floats and doubles as loop indecies.[/quote] Nope, won't do. Try using double and float as your array indices while writing normal programs and you would know the reason. Comparision operators don't cut well with floating point numbes. Read [URL="https://www.securecoding.cert.org/confluence/display/cplusplus/FLP31-C.+Do+not+use+floating+point+variables+as+loop+counters"]this[/URL] and [URL="http://www.cs.princeton.edu/introcs/91float/"]this.[/URL] | |
Re: If creating that function for a standard compiler, you need to adhere to the C/C++ specification. The implementation is upto you. If you want to have a look at some of the implementations see [URL="http://pdcurses.sourceforge.net/"]this[/URL] and [URL="http://www.delorie.com/djgpp/"]this.[/URL] | |
Re: [quote=WaltP;340200]Not quite. it's [inlinecode]minimum + (rand() % maximum);[/inlinecode][/quote] Not quite, its: [inlinecode]minimum + (rand() % (maximum - minimum));[/inlinecode] This will produce random numbers in the range minimum inclusive and maximum exclusive. ;) | |
Re: You must have declared I as an integer variable while size() returns a number of type unsigned integer. Hence the warning message. Try changing the loop variable to type size_t and it should work out to be fine. Read [URL="http://www.cplusplus.com/reference/stl/vector/size.html"]this.[/URL] | |
Re: Keep a counter which will be initialized to 1,[INLINECODE] fgets[/INLINECODE] the entire line of text in a character array, skip the first two lines using the counter previously mentioned and start reading from the third line. Read [URL="http://www.daniweb.com/tutorials/tutorial45806.html"]this[/URL] for using [INLINECODE]fgets.[/INLINECODE] | |
Re: That is because this program requires the proper use of getchar() or cin.get() so that the junk (newline character) is filtered out of the input stream. Also considering that your return statements are in abundance, it becomes a pain in the neck to make out what it is going on. … | |
Re: Congratulations my friend. Hope it feels good to have a star shine by your name... ;) | |
Re: Building something that famous requires a lot of planning and expertise by your side. How many years of developement experience do you have under your belt ? How many people have you by your side ? How far have you reached in this endeavour of yours? Building a database might … | |
Re: It must be some problem with your installation or your OS. Try reinstalling it and if it still doesn't seem to satisfy you, switch to a new IDE and compiler. | |
Re: Linker errors are usually generated when the linker can't find the function definations i.e. the body of the mentioned functions. You need to place the "Serial.h" and "Serial.cpp" file in the same directory as that of the main or driver file and make sure the above mentioned functions are defined … | |
Re: [inlinecode]initialize( x , y , z ) << endl ;[/inlinecode] You can't do this in C++ esp when initialize doesn't return anything and even if it did, you aren't specifying the stream to which the output should be redirected. | |
Re: Your program doesn't work becuase you never assign a value to 'ch'. Try adding [inlinecode]ch = input[i];[/inlinecode] inside the for loop. Oh and btw, use of global variables is a bad programming practice, avoid it. Also don't do redundant comparisions. [code=cplusplus] for(int i = 0; i < length; ++i) { … | |
Re: Double quoted literals are used to define strings, while single quoted literals for characters. Since you are creating an array of characters, you need to enclose the O in single and not double quotes like Wolfy has already said. |
The End.