921 Posted Topics

Member Avatar for brent.lozano001

Rounding a number to the nearest whole number is one of the easiest things you can do in C++ :) there isn't even any need for an if/else statement, take this as an example. [CODE=CPLUSPLUS]float decimal = 3.4f; int rounded = int(decimal + 0.5f); // 3[/CODE] Hope this helps.

Member Avatar for ArkM
0
248
Member Avatar for jasimp

I'm using it now, its good. Only a few things I have noticed: - Doesn't allow you to scroll by clicking the mouse wheel - Full screen flash applications run with a slightly slower FPS

Member Avatar for stephen84s
0
625
Member Avatar for l4z3r

I have made a few mistakes when programming, probably one of my worst, and I still can't quite remember how I did it, but I flooded the desktop with about 10,000 empty files while making a program that splits one file into many smaller ones. ;) Deleting them was even …

Member Avatar for William Hemsworth
0
140
Member Avatar for coveredinflies

Some of this code is wrong, first of all, the class is missing a semicolon at the end, and you are returning a reference wrong. This is how it should be. [CODE]class ThreeD { int x, y, z; public: ThreeD() { x = y = z = 0; } ThreeD(int …

Member Avatar for vijayan121
0
191
Member Avatar for iamthwee

How about using [B]std::valarray[/B]. [CODE=CPLUSPLUS]#include <iostream> #include <valarray> int main(int argc, char **argv) { std::valarray<std::string> arguments(argc); for (int i = 0; i < argc; ++i) arguments[i] = argv[i]; return 0; }[/CODE]

Member Avatar for vijayan121
0
92
Member Avatar for chunalt787
Member Avatar for ionutz
Re: hey

Its pretty much what it says it is, [B]IT Discussion Community for Developers & Technology Enthusiasts[/B]. :icon_neutral: If you have a problem, somebody can help you, or you can decide to help people. But there are a lot of forums here, so its hard to sum it all up into …

Member Avatar for Ezzaral
-1
135
Member Avatar for PuQimX

>I like what your saying.... to be a good programmer we must love the program..!! To be a good programmer, you need to know how to make a program.

Member Avatar for obj7777
0
112
Member Avatar for coveredinflies

Well, I would like to say i've become a fairly good programmer and im fully self-taught, but the really trick to it is [B]READING![/B], you will want to buy yourself a decent [URL="http://www.daniweb.com/forums/thread70096.html"]C++ book[/URL] if you want to learn anything fast. You also have to be willing to practice, and …

Member Avatar for William Hemsworth
0
160
Member Avatar for shooshooo

Learn to post properly, firstly why are you bolding and highlighting every post in red, and secondly, use an appropriate thread name. [URL="http://www.catb.org/~esr/faqs/smart-questions.html#bespecific"]http://www.catb.org/~esr/faqs/smart-questions.html#bespecific[/URL]

Member Avatar for William Hemsworth
0
127
Member Avatar for LuckyMe444

I tried it, and I found only one very small problem. [CODE]#include <iostream> using namespace std; const int N = 20; int main() { int a[N], i, nb, tmp; for (i = 0; i < N; i++) { cout << "Please enter an integer: "; cin >> a[i]; } do …

Member Avatar for LuckyMe444
0
87
Member Avatar for VBNick

Hmm, im not sure if this is exactly what you need, but perhaps you should take a look at [URL="http://msdn.microsoft.com/en-us/library/ms648055(VS.85).aspx"]WM_ERASEBKGND[/URL], it is this message which automatically erases your background when resizing or doing some sort of activity with your window, by doing this manually, you should be able to remove …

Member Avatar for Clockowl
0
88
Member Avatar for sretep2122

Read this before posting.. see if you can figure out what you did wrong, all by yourself :icon_wink: [URL="http://www.daniweb.com/forums/thread78223.html"]http://www.daniweb.com/forums/thread78223.html[/URL]

Member Avatar for VernonDozier
0
207
Member Avatar for goodmuyis

Would you mind giving some more information, perhaps show some code that may be causing the problem or an error message, we can't just "know" what the problem is :icon_cheesygrin:

Member Avatar for Duoas
0
90
Member Avatar for shalin

You just posted in a 4 year old thread, read [URL="http://www.daniweb.com/forums/thread78223.html"]THIS[/URL] before posting again, incase you missed it..

Member Avatar for William Hemsworth
0
998
Member Avatar for Clockowl

Nope, the preprocessor ONLY works before compile time, remember that, so you cant have a mix of the two :) edit: but maby you should look at the [B]typeid[/B] operator, it might be what you need for that example.

Member Avatar for Clockowl
0
94
Member Avatar for princess_19

>Please post in where you are having problems with your code [QUOTE=princess_19]I do not understand anything! I do not even know how to start!!! [/QUOTE] Im assuming she just wants it to be done for her with no effort what so ever.

Member Avatar for Narue
0
146
Member Avatar for William Hemsworth

Click [URL="http://www.dyson.co.uk/about/games/telescope.asp"]HERE[/URL]. Im up to level 23, currently stuck ;) Have fun :)

Member Avatar for sittas87
0
97
Member Avatar for ~s.o.s~

So because you didn't find it funny you gave 4 people unnessasery negative reputation for disagreeing with you... sort of childish :D

Member Avatar for sneekula
3
427
Member Avatar for Dave Sinkula
Member Avatar for William Hemsworth

A friend of mine just sent me this, I found it very funny! :icon_lol: [URL="http://newmedia.funnyjunk.com/pictures/learnchinese.jpg"]http://newmedia.funnyjunk.com/pictures/learnchinese.jpg[/URL]

Member Avatar for ~s.o.s~
3
120
Member Avatar for Ene Uran

how about my first one :) From my hotmail account: [QUOTE]Marie SOLO Church Evangelique 7emeTranche Angré 26 rue 12 Abidjan Cote divoire Dearest brother, Please tell to your father to help me after you finish to read this message i know you have 15 years old. I know this mail …

Member Avatar for Lardmeister
0
161
Member Avatar for amt_muk

[QUOTE=Alex Edwards;685043]Then again I suppose it's not hard... [code=c++] const char *c_string = "c-string"; const char& refChar = c_string[0]; std::cout << &refChar << std::endl; [/code] ...though I'm not near a C or C++ compiler at the moment so I can't confirm if this will work or not @_@[/QUOTE] Or even …

Member Avatar for amt_muk
0
6K
Member Avatar for KraMer

Making the executable small can be surprisingly easier than you think, make sure all your resources are fairly small, keep the code short and simple, and you can even download an executable compressor, which can make huge differences to the size. I use this one, it has never failed me …

Member Avatar for KraMer
0
199
Member Avatar for freelancelote

Theres also another common mistake that people make, which can easily cause memory leaks, consider this example:[CODE=CPLUSPLUS]int *varPtr = new int[1000]; // Allocate 1000 int's int intArray[] = {1, 2, 3, 4, 5}; // Make an array varPtr = intArray; // Assign varPtr with the adress of intArray[/CODE] In this …

Member Avatar for William Hemsworth
0
243
Member Avatar for Ayu1004

I dont quite understand your problem, I ran this test program and everything seemed to run ok. [CODE=CPLUSPLUS]#include <iostream> #include <string> using namespace std; void hello(string &str) { // Do something with str } int main () { string line; cout << "Welcome!" << endl; getline(cin, line); while (line != …

Member Avatar for Ayu1004
0
181
Member Avatar for Fragmad

Thats not the mistake, the problem is that your trying to send keypresses to the window itself, not the text box inside it, you will have to get the handle to the text box in order for that to work.

Member Avatar for Fragmad
0
255
Member Avatar for TechNovice
Member Avatar for kishore84

Why have you made two threads posting the exact same (badly presented) question.. its not going to make it get answered any quicker.

Member Avatar for ArkM
0
150
Member Avatar for ehsan_op
Member Avatar for Ancient Dragon
0
90
Member Avatar for platinum8

Look at [URL="http://www.daniweb.com/forums/thread70096.html"]this[/URL] thread. [B]Manish_Singh[/B] just copied the first books its says on this thread.

Member Avatar for William Hemsworth
0
82
Member Avatar for Zelores

I started learning C++ (which is supposedly harder to learn than Java) at the age of 13, and im completely self taught. All it takes is a bit of time and effort, and it seems you just haven't put in the effort. :-O Theres also plenty of resources over the …

Member Avatar for Zelores
0
165
Member Avatar for vidit_X

Everything seems to work fine, although I don't particularly like the way you have formatted it (white space missed alot and its all very streched) but thats a matter of personal opinion. There were also a couple of compiler warnings to do with assigning [B]l1[/B] and [B]l2[/B] ([B]int[/B]'s) with [B]size_t[/B] …

Member Avatar for ArkM
0
143
Member Avatar for William Hemsworth

Ahh, its soo confusing, I could only see her turning clockwise for about 10 minutes at first, then I could only see her going anti-clockwise.. which way do you see her turning :confused: ?? [URL="http://www.news.com.au/perthnow/story/0,21598,22492511-5005375,00.html"]http://www.news.com.au/perthnow/story/0,21598,22492511-5005375,00.html[/URL]

Member Avatar for GrimJack
0
183
Member Avatar for slytherfreek

Can you post some more code, like the definition of [B]soda_machine->dispenser[x][/B], if the code isn't very long, just post it all.

Member Avatar for slytherfreek
0
138
Member Avatar for dirt14
Member Avatar for tupacpalaman

"The spaces between your fingers were created so that another's could fill them in."

Member Avatar for Minimandz
0
57
Member Avatar for salman1354

Try looking at [URL="http://www.cplusplus.com/reference/stl/vector/"]vectors[/URL], it might be what your looking for.

Member Avatar for grumpier
0
267
Member Avatar for vgould

A way to do this would be to record every relevant message and the time between this message and the last message. To record it you could do something like this: [CODE=CPLUSPLUS] #include <iostream> #include <vector> #include <windows.h> using namespace std; struct Action { HWND hwnd; // Window Handle UINT …

Member Avatar for vgould
0
128
Member Avatar for mammoth
Member Avatar for William Hemsworth
0
79
Member Avatar for Ene Uran

Aperantly the actual number of the beast is [B]616[/B] not [B]666[/B] :) It said on [B]QI[/B]... they NEVER lie!

Member Avatar for mackone
2
108
Member Avatar for Salem

Maby a good idea would be to make a dialog appear just before submitting thats says (in a very big font) "[B]USE CODE TAGS OR YOU WILL BE IGNORED OR YELLED AT!!![/B]" for newbies who have less than 3-4 posts ? Perhaps that will get to em. ;)

Member Avatar for jasimp
1
190
Member Avatar for CoolGamer48

Haven't you been to work experience yet ? When I went to work experience, We (me and another friend) ended up getting a placement at [URL="http://www.juicegames.com/html/home.html"]Juiced Games[/URL] for 2 weeks. That gave me a big experience of what programming can be like in a job. To be totally honest, it …

Member Avatar for William Hemsworth
0
185
Member Avatar for William Hemsworth

I have come across this problem a couple of times, if you reply to a thread, and then within a minute reply again, the order of the posts change like it has done for me in this thread. [URL="http://www.daniweb.com/forums/thread140791.html"]http://www.daniweb.com/forums/thread140791.html[/URL] I dont know if anyone else has ever experienced this problem.

Member Avatar for Ancient Dragon
0
98
Member Avatar for sonicmas

You can save the entire structure as binary, heres an exmaple of how to: [CODE=CPLUSPLUS] #include <iostream> #include <fstream> using namespace std; template<typename type> void SaveStruct(ofstream &out, type &obj) { out.write(reinterpret_cast<char*>( &obj ), sizeof type); } template<typename type> void LoadStruct(ifstream &in, type &targetObj) { in.read(reinterpret_cast<char*>( &targetObj ), sizeof type); } …

Member Avatar for sonicmas
0
166
Member Avatar for rizahbeng

You need to show at least a bit of effort, not just dump a question and expect us to solve it, you haven't even said what your problem is. What do you expect us to do ?

Member Avatar for William Hemsworth
0
141
Member Avatar for Ancient Dragon
Member Avatar for francisprite

[QUOTE=natpu;672024]Try to build SudoKu game. First try for 3 * 3 matrix. If you enter teo or three numbers in the block, it should automatically fill the rest of the fields. Really interesting.[/QUOTE] I managed to make this with a 9 x 9 matrix (in C++ though), its really hard …

Member Avatar for onkar81
0
277
Member Avatar for maui_mallard
Member Avatar for OmniX

This isn't very related to the question, but [B]mahlerfive[/B], here is a few reasons why not to use [URL="http://www.gidnetwork.com/b-61.html"]system("pause")[/URL] .

Member Avatar for OmniX
0
169

The End.