2,839 Posted Topics

Member Avatar for mpCode

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"; } }; …

Member Avatar for mrboolf
0
154
Member Avatar for DefConBandit

[QUOTE=MosaicFuneral;734625]QBasic is a "starter" language.(sometimes)[/QUOTE] QBasic is an "outdated" language. (always)

Member Avatar for punjabivirsa3
0
183
Member Avatar for k59smooth

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..

Member Avatar for Nick Evan
0
84
Member Avatar for k59smooth

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 …

Member Avatar for Nick Evan
0
287
Member Avatar for DJPlayer

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]

Member Avatar for Nick Evan
0
90
Member Avatar for brechtjah

>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 …

Member Avatar for brechtjah
0
192
Member Avatar for elsa87

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?

Member Avatar for WaltP
0
209
Member Avatar for Lokolo

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 …

Member Avatar for Alex Edwards
0
190
Member Avatar for jwaldron82

[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 …

Member Avatar for jwaldron82
0
130
Member Avatar for r.anshul

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? …

Member Avatar for r.anshul
0
246
Member Avatar for nectionplayer

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.

Member Avatar for Nick Evan
0
109
Member Avatar for omaranwar

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] …

Member Avatar for Nick Evan
0
229
Member Avatar for Opheliha

[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?

Member Avatar for Nick Evan
0
145
Member Avatar for mibit

[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 …

Member Avatar for Nick Evan
0
108
Member Avatar for darren2005

[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 …

Member Avatar for darren2005
0
578
Member Avatar for Stefano Mtangoo

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 …

Member Avatar for Nick Evan
0
100
Member Avatar for ioclick

[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.

Member Avatar for GrimJack
0
150
Member Avatar for anbuninja

[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 …

Member Avatar for WaltP
0
140
Member Avatar for Jason123

[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 …

Member Avatar for ArkM
0
179
Member Avatar for NinjaLink

Show an example of what you mean. This will probably get you more responses then bumping your thread every 5 minutes.

Member Avatar for NinjaLink
0
203
Member Avatar for uw1

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?

Member Avatar for uw1
0
101
Member Avatar for michaelraj

[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.

Member Avatar for Nick Evan
0
82
Member Avatar for ariesangel

[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 …

Member Avatar for ariesangel
0
160
Member Avatar for d1s_0n3_guy

[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 :)

Member Avatar for d1s_0n3_guy
0
214
Member Avatar for Raulin

>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 …

Member Avatar for Raulin
0
110
Member Avatar for Evil Genius

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. …

Member Avatar for Evil Genius
0
134
Member Avatar for SteelSlasher

[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 …

Member Avatar for Ezzaral
0
230
Member Avatar for Lukezzz

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.

Member Avatar for Lukezzz
0
89
Member Avatar for AcidG3rm5
Member Avatar for Nick Evan
0
210
Member Avatar for clutchkiller

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 …

Member Avatar for Nick Evan
0
113
Member Avatar for tupacpalaman

[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 :)

Member Avatar for William Hemsworth
0
201
Member Avatar for divyendu

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 ;)

Member Avatar for MattEvans
0
190
Member Avatar for ZZucker
Member Avatar for Lardmeister
0
1K
Member Avatar for Siegoo

[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 …

Member Avatar for bigdognec
0
187
Member Avatar for Alex Edwards

[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 …

Member Avatar for sidatra79
0
162
Member Avatar for cakka

[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] :)

Member Avatar for robertek
0
202
Member Avatar for suganzeni

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.

Member Avatar for vinu_32123
0
219
Member Avatar for Nick Evan

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 …

Member Avatar for Nick Evan
0
148
Member Avatar for abelingaw
Member Avatar for jeevsmyd

[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. …

Member Avatar for Sci@phy
0
659
Member Avatar for adityasaten

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!

Member Avatar for abhijeetcn
0
119
Member Avatar for J-son

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 …

Member Avatar for abhijeetcn
0
148
Member Avatar for freelancelote

[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 :)

Member Avatar for freelancelote
0
126
Member Avatar for Se7Olutionyg

[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]

Member Avatar for Aia
0
157
Member Avatar for happy8899

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.

Member Avatar for dougy83
0
369
Member Avatar for tones1986

[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] …

Member Avatar for skatamatic
0
430
Member Avatar for mtrepanier

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]

Member Avatar for mtrepanier
0
74
Member Avatar for Alex Edwards

[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 …

Member Avatar for skatamatic
0
169
Member Avatar for r00ster

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 :)

Member Avatar for ArkM
0
97
Member Avatar for NinjaLink

[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 …

Member Avatar for NinjaLink
0
166

The End.