6,741 Posted Topics

Member Avatar for botter911

>But what I wanted was that even if user is in the middle of the program >when the user presses F1 it immediately restarts the program. What you want is an event, or a separate thread that polls for keypresses. Either way you'll be relying on even more nonportable features, …

Member Avatar for botter911
0
115
Member Avatar for nachon

>Can´t Builder build and run my simple cpp old files? Builder has no problem with standard C++. Quite likely your "simple" C++ programs aren't conforming to the standard, and thus are only guaranteed to work on the compiler that they were written with. Post your code and the errors Builder …

Member Avatar for nachon
0
145
Member Avatar for mauro21pl

>It is C program. No, it's a C++ program. How do I know? Because GCC doesn't compile it and the error sounds very much like an out of order variable declaration, I seriously doubt you're compiling with the "-std=c99" switch that enables mixed declarations. Since it works on Windows, I …

Member Avatar for stilllearning
0
87
Member Avatar for deepugtm
Member Avatar for Narue
0
69
Member Avatar for mugun

>i need help in inserting a particular string to a particular line in a text file.....is that possible It's possible, but not directly. You need to rewrite the file from beginning to end and insert your modified parts at the appropriate place.

Member Avatar for mugun
0
180
Member Avatar for deepugtm

The C language doesn't know squat about graphics. You need to learn about the third party APIs (such as Qt, Win32, Allegro and SDL), choose which one you want to use based on the needs of your programs, and then learn how to use it. It goes without saying that …

Member Avatar for Narue
0
159
Member Avatar for jessiemcmillan

Ah, yet another mindless Microsoft hater who clearly isn't aware of the issues and thinks that calling Bill Gates evil will say everything that needs to be said. Blanket statements like that just serve to indicate your idiocy and lack of awareness. But to answer the request, I have nothing …

Member Avatar for Zappaboss
-1
359
Member Avatar for ashkash

You need to do some converting. Do some research on the std::hex stream manipulator for ideas.

Member Avatar for ArkM
0
97
Member Avatar for JackDurden

>when it leaves I want it to hold the words entirely not just the letters That's what it appears to do (after ArkM's fix, of course). I'd wager that you're not using the returned vector correctly. Can you post how you use example?

Member Avatar for Narue
0
121
Member Avatar for mus1010

>Your post is not going to get you answers Indeed. mus1010, it's generally wiser to show respect to the people kind enough to reply to you. Keep in mind that in replying, they're showing you a substantial measure of respect simply by not ignoring yet another "I don't know anything, …

Member Avatar for LizR
0
335
Member Avatar for Avaleriona

>I have difficulty to solve it What have you tried? Saying you've had "difficulty" is pretty vague.

Member Avatar for Narue
0
173
Member Avatar for kux

>So there's a size mismatch. And yet, the error doesn't say size mismatch, it says signed/unsigned mismatch. Your analysis is logical, but incorrect. >why is it stated signed/unsigned mismatch when all >variables are unsigned and no overflow is possible? Because this is a case where the integral promotions can bite …

Member Avatar for kux
0
133
Member Avatar for msundastud
Re: Help

What you have looks good, except for a couple of nits: >printf("what is your age? "); >scanf("%d", &age); There's no guarantee that the prompt will be shown before scanf starts blocking for input. Which means that on some systems, all the user will see is a blinking cursor and they …

Member Avatar for msundastud
0
63
Member Avatar for daviddoria

Assuming you have control over glutMouseFunc, you need to overload it to accept a pointer to a member function: [code=cplusplus] class Plot { public: void MouseButton(); }; void glutMouseFunc ( void (Plot::*pmf)() ) { //... Plot p; (p.*pmf)(); //... } [/code]

Member Avatar for kux
0
670
Member Avatar for ballinloughan

>What happens if Reg1 = 00000001 and Bit0 = 1 initially ?? What do [b]you[/b] think? Run through the same process and see what you can figure out. After all, it won't do for someone else to hold your hand through figuring out every combination of values you can think …

Member Avatar for ballinloughan
0
109
Member Avatar for sham

It's pretty simple, really, kinda sorta. You have a base class with a virtual function, and a derived class that redefines the virtual function. By creating a reference to an object of the base class and initializing it with an object of the derived class, the virtual function will call …

Member Avatar for digitaldesperad
0
229
Member Avatar for Majestics

>Is there a reason not to use strtod( )? I can only think of one reason, but it's a doozy. strtod works in the wrong direction. The OP wants a conversion from float-point to string, not string to floating-point.

Member Avatar for stilllearning
0
2K
Member Avatar for cam875

It depends on the compiler. Both methods have been done, as well as translating from C++ to C, which is then compiled however the C compiler handles it. However, you'll find that most compilers have a switch that give you assembly output whether the compiler itself has a separate assembly …

Member Avatar for ArkM
0
141
Member Avatar for skatamatic

>DoDMA(); //allocate memory for the headers >BMPInfoHead = objCopy.BMPInfoHead; >BMPFileHead = objCopy.BMPFileHead; This strikes me as a memory leak. If DoDMA allocates memory to BMPInfoHead and BMPFileHead, you lose your only reference to the new memory by overwriting the addresses with this in objCopy. >I'm looking for a fast, preferably …

Member Avatar for skatamatic
0
248
Member Avatar for AutoC
Member Avatar for hervens

>I was wandering if anyone knows any good hardware programming tutorials, or books in c++ I don't know about the quality, but I have seen them around. Searching google will give you the tutorials and communities, and a good computer bookstore should have at least one book on embedded programming. …

Member Avatar for dougy83
0
349
Member Avatar for bamabambhole01

Communication must not be your strong point. Why don't you post the requirements of your program instead of trying to summarize it in cryptic A-B talk. :icon_rolleyes:

Member Avatar for bamabambhole01
0
94
Member Avatar for balakrishnan.kb
Re: c++

Assuming you mean final as applied to methods, the two are basically opposites due to default virtualness. In C++, member functions are not virtual by default, so the virtual keyword is used to enable virtual behavior. In Java, methods [I]are[/I] virtual by default, so the final keyword is used to …

Member Avatar for Alex Edwards
0
108
Member Avatar for stormtr00per

>char newname[] = ""; Good luck with that. Keep in mind that the absolute size of newname is 1, and be sure not to overflow the array. Don't forget to terminate your string with '\0'. ;) >strcpy (newname, the_date ); Oops, $10 says you overflow the array 100% of the …

Member Avatar for Ancient Dragon
0
121
Member Avatar for monkey_king

There are two problems. First, you can't provide a pointer to a template, it has to be a pointer to an instantiation of the template. Translation: provide the template arguments: [code=cplusplus] Array<int> var = apply ( m, &sum<int> ); [/code] The second problem is that there's a mismatch between the …

Member Avatar for monkey_king
0
8K
Member Avatar for JoBe
Member Avatar for JoBe
0
139
Member Avatar for melissajohn718

Seeing as how your posts follow the pattern of "Do it for me because I'm too special to learn", I've merged them into one thread so they can be more easily dismissed by the regulars.

Member Avatar for Narue
0
182
Member Avatar for neuronimbus
Member Avatar for Dave Sinkula
0
142
Member Avatar for moshe12007

>First of all, this: [ICODE]for(i=1; i<=100000000; i++){//its loop time [/ICODE] >is a horrible way to create a 'timer'. Yes indeed. It relies too heavily on the clock speed of the machine. For example, I have busy loops constructed like this that ran for exactly one second in the mid 1990s, …

Member Avatar for Salem
0
178
Member Avatar for Jennifer84

There's also a SelectionFont property: [code=cplusplus] this->richTextBox1->Select( 0, 10 ); Font^ current = this->richTextBox1->SelectionFont; this->richTextBox1->SelectionColor = Color::Red; this->richTextBox1->SelectionFont = gcnew Font ( current->FontFamily, current->Size, FontStyle::Bold ); [/code]

Member Avatar for Jennifer84
0
131
Member Avatar for monkey_king

>But if I use a array<int>, i don't want it to return >a array<int>, it should return a array<float>. Overloads can't differ only by return type. If you want an object of Array<float>, copy your Array<int> to it, then do the division. That's much easier and cleaner than the hoops …

Member Avatar for monkey_king
0
112
Member Avatar for nizbit

>cdArray[num_cds].print(out); cdArray is an array of char. cdArray[num_cds] is a char. char doesn't define any member functions. I'll let you figure out the rest of the errors, as they're the same thing.

Member Avatar for Lerner
0
241
Member Avatar for mauro21pl
Member Avatar for mauro21pl
0
82
Member Avatar for balakrishnan.kb

Virtual functions are the backbone of runtime polymorphism. You can use a member function declared as virtual to redefine the behavior of a base class. Then, when accessing a derived class through a pointer or reference to the base class, the redefined member function will be called: [code=cplusplus] #include <iostream> …

Member Avatar for Narue
0
109
Member Avatar for AlSal

If you mean a complete reference of the standard library, I prefer [URL="http://www.dinkumware.com/manuals/"]Dinkumware[/URL]. If you mean all libraries under the sun (as some bozos come here expecting), it doesn't exist.

Member Avatar for BeyondTheEye
0
94
Member Avatar for Extreme

>if(m==n) n is zero at this point, remember? Use a copy of n for your loop counter so that the original value is preserved.

Member Avatar for Ancient Dragon
0
185
Member Avatar for sirbriggs

>invalid conversion from ‘const char*’ to ‘int’ Yep, that's what should happen. You say that Set should take a parameter of type T, where T is specified by the template class. If you pass a value that doesn't match the type of the template class and isn't compatible, you'll get …

Member Avatar for sirbriggs
0
164
Member Avatar for l4z3r

>Now, wouldnt you say it is embarrassing for a programmer having used linked >lists and pointers for about 1.5 years to have used "-->" instead of "->"??? When I've been writing C and C++ for well over a decade and still type mian instead of main over 60% of the …

Member Avatar for William Hemsworth
0
140
Member Avatar for kyutlene

Since you're new here, I'll direct you to our [URL="http://www.daniweb.com/forums/faq.php?faq=daniweb_policies"]rules[/URL]. Specifically, discussion of how to write viruses is prohibited by Keep It Legal. As such, I'm also closing this thread.

Member Avatar for Narue
0
109
Member Avatar for coveredinflies

>This is checking you haven't done a self-assignment right? Yes, though that check is actually less effective than simply writing your code in such a way as to make it unnecessary. >Sorry what is sceleton slang for though? It's slang for skeleton, and I'm sure any dictionary will tell you …

Member Avatar for vijayan121
0
191
Member Avatar for Emerald214
Member Avatar for iamthwee

>How about using std::valarray. Why? That seems like a case of using valarray for the sake of using valarray. Kind of silly, in my opinion.

Member Avatar for vijayan121
0
92
Member Avatar for agentx

You can't get pseudocode wrong, just concentrate on the steps and outline them. For example: [code] read a test score is it less than 50? add a failing score otherwise add a passing score [/code]

Member Avatar for Narue
0
112
Member Avatar for coveredinflies

>I am just interested to know how many people here >have managed to become good by learning themselves. I'm largely self-taught. You can decide for yourself if I meet your definition [b]good[/b] or not. >Also would be interesting to know the general perception >of self-taught programmers by profesionals is? The …

Member Avatar for William Hemsworth
0
160
Member Avatar for coolcampers
Member Avatar for Narue
0
2K
Member Avatar for Raija

>but the second number can´t be same as the first one. That's not very random. :icon_rolleyes: Assuming you want the full range of rand minus the numbers already selected, you're pretty much stuck with re-selecting if you pick the same number: [code=cplusplus] #include <algorithm> #include <cstdlib> #include <iostream> #include <iterator> …

Member Avatar for Narue
0
108
Member Avatar for Azurea

>But are break and continue generally frowned upon because of that? Some people frown on break and continue because they don't see them as "pure" structured programming techniques. These people are generally too weak willed to use the best solution available or lack real-world experience where purity is, more often …

Member Avatar for Salem
0
97
Member Avatar for xr0krx

>but it doesnt work the same because you have to press enter every single time. Be clear about your assignment first. Are you required to use raw input to achieve the correct behavior, or did you use getch because you personally think the result is better? This might be a …

Member Avatar for Narue
0
119
Member Avatar for policeachan

>who wrote the functions printf, scanf . You mean who "writes" the functions. Generally every new compiler re-implements printf and most or all of the standard library and the author of the compiler does it (or someone on the team if there's more than one programmer). >what is it's sourcr …

Member Avatar for Narue
0
170
Member Avatar for Demonisya

Please use code tags and properly format your code. We'll give you a little leeway to learn how the forum works, but after a while (10 posts in general, but less if we feel you're intentionally refusing) you'll begin receiving infractions for breaking Daniweb's rules if you habitually fail to …

Member Avatar for Demonisya
0
309

The End.