2,839 Posted Topics
Re: These are all working solutions, but why not add a a type-field to the base class? Example: [code=cplusplus] /* base Creature class*/ class creature { public: std::string what_type; creature() {what_type = "undefined";} }; /* derived class alien */ class alien: public creature { public: alien(){ what_type = "alien"; } }; … | |
Re: [QUOTE=MosaicFuneral;734625]QBasic is a "starter" language.(sometimes)[/QUOTE] QBasic is an "outdated" language. (always) | |
Re: Aahh.. a double thread. I answered this already [URL="http://www.daniweb.com/forums/thread158225.html"]here[/URL], which kinda makes me look stupid since vmanes already answered it.. | |
Re: If you're using chars, then use single quotes instead of double. Double quotes are for strings (more then 1 char). So it would look like this: [code=cplusplus] char Letters[26] = {'a','b','c', /*etc etc etc*/ }; [/code] But the easier way to do this, would be to initialize them as a … | |
Re: google for xxxx tutorial: [URL="http://www.cplusplus.com/doc/tutorial/polymorphism.html"]polymorphism[/URL] [URL="http://www.cplusplus.com/doc/tutorial/inheritance.html"]inheritance[/URL] | |
Re: >I don't understand that. If you have something that outputs 1 (integer) and you add '0', doesn't that make 10? Read what Narue already told you: >By adding the integer value of '0' to the digit, you effectively shift the value of the digit into one of the representable values … | |
Re: What you're trying to do here: [code=cplusplus] If(ptr->info==item) { int Count_Max(node_ptr&q,int x) { [/code] is wrong. You can't declare a function inside another function. Are your really using a linked list or did someone just give you that code? | |
Re: If transactionInfo is a std::string, you could do something like: [code=cplusplus] transactionInfo = static_cast<std::string>(date) + " - "+ _strtime( time ) + "New Customer - 1001 - Olly";[/code] As you can see time is already used in C++, so you might want to use another variable name. Also[ICODE] _strtime()[/ICODE] is … | |
Re: [QUOTE=jwaldron82;738665] implementating a system for a public school which will ultimately replace an old manual system that they use. [...] My question is what are some of the steps or stages that are mandatory that should be included this study. [/QUOTE] What should this "system" do? Alarm, make coffee, check … | |
Re: Close, but a few things: - it's [icode]int main()[/icode] and [icode]return 0;[/icode] Click [URL="http://faq.cprogramming.com/cgi-bin/smartfaq.cgi?answer=1044841143&id=1043284376"]here [/URL]for info - Clrscr() is not standard. I'm using VS2008 and my compiler would say "identifier not found". Click [URL="http://faq.cprogramming.com/cgi-bin/smartfaq.cgi?answer=1031963460&id=1043284385"]here [/URL]for info - same goes for [icode] #include <graphics.h>[/icode] Did you test the Decimal to binary? … | |
Re: And now try compiling this on something that isn't outdated and non-standard and see if it compiles.... Furthermore, even dribble like this should be placed in [URL="http://www.daniweb.com/forums/misc-explaincode.html"]code tags[/URL]. Learn how to use them. | |
Re: The Altera DE3 board came with a CD right? My bet is that is has a sample program usb-host/device. All Dev-boards I've ever worked did anyway. [edit] yup. I was [URL="http://www.terasic.com.tw/cgi-bin/page/archive.pl?Language=English&CategoryNo=39&No=260&Revision=103&PartNo=5#section"]right[/URL] [edit2] According to [URL="http://www.terasic.com.tw/cgi-bin/page/archive.pl?Language=English&CategoryNo=39&No=260&Revision=103&PartNo=3#section"]this[/URL], it came with an [URL="http://en.wikipedia.org/wiki/Api"]API[/URL], so you might want to try reading some documentation... [/edit2][/edit] … | |
Re: [QUOTE=Opheliha;738630] Can anyone tell me of this is possible? [/QUOTE] Probably. What's a SAP? What programming skills do you have? What do you know about communication protocols? | |
Re: [QUOTE=ithelp;738479]That is nice way to hide the fact that someone else is doing your homework . Innovative idea.[/QUOTE] I agree. First I thought the OP was just too lazy to even type the requirements here, but I see that you're right. I always wonder why people are smart enough to … | |
Re: [QUOTE=darren2005;734987] Would it be: [ICODE]str.insert(53,setjava);[/ICODE] For [..] 53 being the 53rd character -Sorry, I am beginner at this! [/QUOTE] Why don't you just try it and see? You might want to put [i]setjava[/i] in double quotes "setjava". If you have no experience in C++ (which I'm assuming), you might be … | |
Re: if you have python installed (which I'm assuming you have) the python.h file would be in your pyhton25\include directory. I've never used code::blocks, so I can't tell you exactly how; but you should add the python\include directory to your project as an additional include directory. Or if that isn't possible … | |
Re: [QUOTE=jbennet;735357]Those strange kneeling chairs are quite good[/QUOTE] I agree. Also yoga (yes, I know...) helped me a lot in the past. | |
Re: [QUOTE=anbuninja;735534] Also I still havent put if hours exceed 744 to cout invalid. thing is im already using hours in another calculation so i think it wont work if i put if (hours >= 7444) [/quote] It doesn't matter that you already used it once. Just add the line were … | |
Re: [QUOTE=Jason123;735713]Is this the correct way?[/quote] Starting to look like it :) Next you'll have to figure out how to split the string into numbers and discard the comma's. So you'll need a sort of [URL="http://oopweb.com/CPP/Documents/CPPHOWTO/Volume/C++Programming-HOWTO-7.html"]tokenizer [/URL]. Since you don't know how many numbers are in the input string, you should … | |
Re: Show an example of what you mean. This will probably get you more responses then bumping your thread every 5 minutes. | |
Re: Should work fine. The error is probably the result of something else in the code. Can you post a small example of code that crashes? | |
Re: [QUOTE=michaelraj;735842]hi friend,i need an project title for my final year project in bca............[/QUOTE] Try reading [URL="http://www.catb.org/~esr/faqs/smart-questions.html"]this [/URL]and repost when your done. | |
Re: [QUOTE=ariesangel;735755] pls tell me how the rand() function work.[/QUOTE] According to Cplusplus.com, rand() returns a pseudo-random integral number in the range 0 to RAND_MAX. This number is generated by an algorithm that returns a sequence of apparently non-related numbers each time it is called. This algorithm uses a seed to … | |
Re: [QUOTE=vmanes;735085] I kind of like your for loop - clever way you end it. [/QUOTE] As do I. Which automatically makes me believe that it's part of the assignment given by the teacher :) | |
Re: >m = rand()/50; //as random number normally big,I just divide it to make it smaller number, am not sure it is true or not n = rand()/80; You're wrong :) If you want a number in the range 0-49 (an array of 50) you should use something like this: m … | |
Re: That's not really hard if I understand your (rather vague) requirements correctly. - take in a number - if it's bigger then 40: subtract 40 and store the rest - multiply the rest with 1,5 and add to 40 - multiply the outcome with hourly rate - done [edit] ps. … | |
Re: [QUOTE=Rashakil Fol;734276]There's nothing insane about writing a parser.[/QUOTE] He didn't say it was: [quote=MosaicFuneral] not everyone is insane as me. Sitting here writing a script parser for a game. [/quote] As you can see, (s)he's just stating that he's insane [i]and[/i] writing a parser. I can imagine that that's a … | |
Re: I'm not sure, but if you just hit F5, only code that changed will recompile. Unmodified code will be left as it was. But I might be wrong and I can't test it right now. | |
Re: you forgot to add the "const" keyword after the definition | |
Re: A few tips: in case 1: you're using the variable Clist which isn't declared yet. (you're declaring it in case 4) This: [code] Clist.open(); cout<<Clist; [/code] is not the way to view a text-file. [URL="http://www.cplusplus.com/doc/tutorial/files.html"]Here's[/URL] a tutorial. You should always check if opening your file succeeded, before trying to read … | |
Re: [QUOTE=R0bb0b;694442] I don't understand a damn thing they're saying but something about it just works.[/QUOTE] That's probably a good thing, since their lyrics aren't very...euhm.. sophisticated :) | |
Re: The short answer is: OpenGL is easier to implement and DirectX has better performance. google should [URL="http://www.google.nl/search?hl=nl&q=opengl+vs+directx&btnG=Google+zoeken&meta="]tell you more[/URL] I'm not going to do your homework for you ;) | |
| |
Re: [QUOTE=addy999;478207]You will get the password from rockstargames.com .......[/QUOTE] What are you talking about? What does rockstar have to do with anything here? To OP: Please try to define your problem more clearly then this.. Where is this script you're talking about? [edit]So you've 'made' a game and you're trying to … | |
Re: [QUOTE=Alex Edwards;692999] This makes me curious, though. If this language is so versatile and variable, why is there no forum dedicated to design-ideas and refinement of UML? [/QUOTE] Not enough posts/week. If there was a forum for each specific language, people would get lost in the overwhelming amount. UML questions … | |
Re: [QUOTE=cakka;695825]@Ancient Dragon Where i can get the free compiler ? [/quote] If you don't mind, I'll give you the link instead of AD: [URL="http://www.microsoft.com/Express/VB/"]click[/URL] :) | |
Re: You could do that with sql: [code]CREATE TABLE IF NOT EXISTS foo (bar int)[/code]This creates a table foo, only if it hasn't been created before. | |
In the past I've used vsftpd for File transfer. Installing this was quite easy: - yum install vsftpd - go to 'services' and click start. Now it would be up and running. This has always worked for me, but now I'm required to use Tftp as a server. So I … | |
Re: [QUOTE=jeevsmyd;703234] No red colour this time.... anyway pls help me[/QUOTE] No red color, but also no [URL="http://www.daniweb.com/forums/announcement8-3.html"]CODE-TAGS[/URL]. Learn to use them by clicking the [URL="http://www.daniweb.com/forums/announcement8-3.html"]link[/URL]. Next a few things: - [URL="http://en.wikipedia.org/wiki/Indent_style"]code formatting[/URL] - [URL="http://faq.cprogramming.com/cgi-bin/smartfaq.cgi?id=1043284376&answer=1044841143"]void main/int main/main[/URL] - getch() isn't standard C, getchar() is. - [URL="http://faq.cprogramming.com/cgi-bin/smartfaq.cgi?answer=1031963460&id=1043284385"]clrscr[/URL](); And now for your problem. … | |
Re: We don't give away free homework here. Post the code that's you've made and tell us what's wrong with it. When you show that you've put some effort in it, you'll get help! | |
Re: A few things: it's [icode]int main()[/icode], and you have to [icode]return 0;[/icode] The other thing is, that you didn't tell the compiler what the function "name" should return. I'll asume it's void? The last thing is that you didn't define the function "name" before you use it. So you'll have … | |
Re: [QUOTE=dmanw100;703113]You can loop through a string and find the '/0' though, correct?[/QUOTE] Almost. You can loop through a c-style-string (an array of char) and find the '\0' (backslash) to find it's length. But you could also use strlen() which is a function specially made for this :) | |
Re: [QUOTE=Se7Olutionyg;703935]if we don't use cin.get . How can we keep the program so that we can see the result, it will run really quick. thanks for answering.[/quote] Just put [i]one[/i] [ICODE]cin.get(); [/ICODE]in your program, before the [ICODE]return 0;[/ICODE] in [ICODE]main()[/ICODE] | |
Re: The easy way would be to use the [URL="http://sourceforge.net/project/showfiles.php?group_id=22870"]OpenCV [/URL]library which has special function for this. | |
Re: [QUOTE=jeevsmyd;703250] HEY DUDE HERE IS A SIMPLE PROGRAM TO FIND PRIME NUMBERS[/QUOTE] the [URL="http://www.daniweb.com/forums/faq.php?faq=daniweb_policies"]rulebook[/URL]. We don not give a way free code here. - use[URL="http://www.daniweb.com/forums/misc-explaincode.html"] code tags[/URL] when posting code - [URL="http://en.wikipedia.org/wiki/Indent_style"]code formatting[/URL] - [URL="http://faq.cprogramming.com/cgi-bin/smartfaq.cgi?id=1043284376&answer=1044841143"]void main/int main/main[/URL] - getch() isn't standard C, getchar() is. - [URL="http://faq.cprogramming.com/cgi-bin/smartfaq.cgi?answer=1031963460&id=1043284385"]clrscr[/URL](); - use [URL="http://tottinge.blogsome.com/meaningfulnames/"]meaningful names[/URL] … | |
Re: I don't know what you're asking, but if you're looking for a random-generator, you need the [URL="http://en.wikipedia.org/wiki/Mersenne_Twister"]mersenne twister[/URL] | |
Re: [QUOTE=Alex Edwards;703258] He mentioned that memory isn't really created upon invocation of "new" in C++, [/quote] Well not 'created', but it reserves a piece of memory for your program. This piece can not be used by any other program. [QUOTE=Alex Edwards;703258] I wonder... is there any way to unfence memory … | |
Re: You are actually passing the array by reference, although you aren't using the & operator. When you say this: [icode]convertToLowerCase(first);[/icode] You're actually saying this: [ICODE]convertToLowerCase(&first[0]);[/ICODE] and voila: pass by reference :) | |
Re: [QUOTE=NinjaLink;702680]I'm still getting a blank. I think my for loop is wrong, [/QUOTE] You're right. A lot (if not all) of your loops are wrong. ArkM already told you so, but I'll try to clarify: If you have an array with say 5 elements: [icode]int a[5];[/icode] This means that you … |
The End.