Forum: C++ Oct 19th, 2009 |
| Replies: 5 Views: 284 The constructor is called when (= at the time) an object of a class is created.
The object's destructor is called at the time the object is destructed.
When you've manually allocated memory inside... |
Forum: C++ Oct 13th, 2009 |
| Replies: 6 Views: 625 No offense, but I'm not an "avaricious" person like others, I'll do it for only $500 :P
(that's 200 times cheaper than Ancient Dragon's offer :)) |
Forum: C++ Oct 10th, 2009 |
| Replies: 7 Views: 405 http://www.gidnetwork.com/b-61.html |
Forum: C++ Sep 20th, 2009 |
| Replies: 6 Views: 1,525 I already know this kind of game: we make suggestions and never it's a good suggestion because either it's too difficult, or too easy, or too boring, or whatever else.
You know what you can and... |
Forum: C++ Sep 19th, 2009 |
| Replies: 8 Views: 589 Post down your code please. |
Forum: C++ Sep 12th, 2009 |
| Replies: 36 Views: 1,411 Okay, I really have enough of your double postings in your thread:
a) you won't get help faster by doing this
b) you just make your own thread unreadable
c) you waste your time, use that time to... |
Forum: C++ Sep 8th, 2009 |
| Replies: 36 Views: 1,411 First of all I want you to NOT PM me with your questions to do it for you, it won't work, I'm a free person and I'm free to do what I want, and not to do what I don't want (let that be clear).
What... |
Forum: C++ Sep 6th, 2009 |
| Replies: 7 Views: 647 The part on how to fix it:
I see you want to compare a string-variable with a string literal, but you're doing something wrong: you're using the =-operator, this operator is also called the... |
Forum: C++ Sep 5th, 2009 |
| Replies: 17 Views: 738 To the OP:
No offense, but I can't trust the code you posted down.
Wait, let me explain, I came across a line which looked quite strange to me, and which will never let me compile this program:... |
Forum: C++ Aug 29th, 2009 |
| Replies: 35 Views: 1,622 Yep, if you use bitwise AND, then only if the two corresponding bits are one, then the bit in the outcome is also one, otherwise it is always zero (you can derive this rule from that truth table).
... |
Forum: C++ Aug 26th, 2009 |
| Replies: 35 Views: 1,622 Not always necessary, but in this case it seems most appropriate.
Just take the way which is easiest for you, and in most cases, it's directly inputting the value.
(If the value is in another base... |
Forum: C++ Aug 25th, 2009 |
| Replies: 2 Views: 291 NOTE: Throughout my whole post I assume that bytes consist out of eight bits.
When you use the XOR-algorithm to hash/encrypt your data, there's no need to implement a different way to decrypt your... |
Forum: C++ Aug 21st, 2009 |
| Replies: 11 Views: 863 Actually, an array is a list/set of variables, for example:
int array[15];
The above array reserves memory for 15 elements (of type int) (as all arrays start with element 0, the upperbound of... |
Forum: C++ Aug 15th, 2009 |
| Replies: 1 Views: 245 -> is called the arrow operator and is often used to access the data members of a structure (via a pointer).
Consider a structure which looks like this:
struct dog
{
string name;
int age;... |
Forum: C++ Aug 15th, 2009 |
| Replies: 19 Views: 722 Hmm, smells like you need a structure (often abbreviated as: struct).
structs are used to group related variables into a new user-defined type, let me give you an example, you want to store the... |
Forum: C++ Jul 29th, 2009 |
| Replies: 1 Views: 602 >can who suggest me for c mini project ....
Yes, do a forum search. (it will give you plenty of ideas)
>u can also give source code .....
No, you'll have to write that yourself. |
Forum: C++ Jul 28th, 2009 |
| Replies: 9 Views: 9,454 This thread is already about 2 years old, and you're still replying in it.
If someone wants to read a good book about C++, then he can check out the sticky... |
Forum: C++ Jul 26th, 2009 |
| Replies: 4 Views: 236 >And, I don't understand the reason why you initialise multipy as a string with 2 characters?
Each character string needs a null-terminator.
But I too see no point in using a string here.
It would... |
Forum: C++ Jul 21st, 2009 |
| Replies: 19 Views: 585 To start: a foreword on the use of gets()
Damn, how could I have overlooked this:
gets(name);
To the OP, and everyone else who still uses gets to get user input: don't use it anymore, C++ has... |
Forum: C++ Jul 21st, 2009 |
| Replies: 8 Views: 352 Logarithms should work as well because you can just derive it to search a power of two.
But, instead of the +1, why not round it?
BTW, iamthwee, you forgot a zero at the end of the number, that... |
Forum: C++ Jul 17th, 2009 |
| Replies: 6 Views: 263 I guess you should buy a new keyboard, your comma key appears to be broken.
>how to deal with it???
Read this (http://catb.org/esr/faqs/smart-questions.html) and fix it. |
Forum: C++ Jul 16th, 2009 |
| Replies: 9 Views: 359 This is not a solution to your question, I only want to show you how your code would look like in more decent C++, so I basically just changed your code.
#include <iostream>
#include <fstream>... |
Forum: C++ Jul 15th, 2009 |
| Replies: 18 Views: 1,010 AD:
*t = _totoupper(*s);
I don't know that function, please tell me about it :P |
Forum: C++ Jul 14th, 2009 |
| Replies: 10 Views: 669 I have to agree with niek_e, since there's really no reason to not want to see the warnings.
Or are you really begging for bugs in your program?
A warning should be taken seriously, because it... |
Forum: C++ Jul 11th, 2009 |
| Replies: 7 Views: 432 Well, you want recursion?
Then go to this thread and read my post: http://www.daniweb.com/forums/post914703.html#post914703 |
Forum: C++ Jul 10th, 2009 |
| Replies: 10 Views: 555 Hey AD, where are you increasing i ?
According to that code, all the elements after element 0 in the ints array will remain zero, only the first element (element 0) would be able to change.
So I... |
Forum: C++ Jul 9th, 2009 |
| Replies: 3 Views: 469 >I also want to read from the passwords file and check if the password has been already generated...... If yes, then generate a new password .....
Well, you could for example at the start of the... |
Forum: C++ Jul 2nd, 2009 |
| Replies: 5 Views: 188 >WARNING: NO NEW LINE AT THE END OF FILE
>What should I do?
Move your cursor to the end of the latest line of your file and press ENTER.
Then try recompiling your source, the warning should be... |
Forum: C++ Jun 29th, 2009 |
| Replies: 5 Views: 283 Consider the following code:
#include <iostream>
int main()
{
int a[5] = {0, 5, 2, 3, 4};
int *p = a;
++*++p; |
Forum: C++ Jun 28th, 2009 |
| Replies: 9 Views: 601 >Why would we need to make something private within a program?
Well, that's just the principal of data encapsulation: It's better that you let the object manage his own data members (in this... |
Forum: C++ Jun 28th, 2009 |
| Replies: 18 Views: 744 Most of the time, the functions to create a GUI are part of an API, but the difference lies in the fact that an API doesn't necessarily have to feature a GUI, we could for example talk about a... |
Forum: C++ Jun 28th, 2009 |
| Replies: 11 Views: 851 >I was trying to explaining op the purposes of using a copy constructor with that,thats it,I know the way I took is hopeless.
Why not just providing some links?... |
Forum: C++ Jun 25th, 2009 |
| Replies: 7 Views: 252 To be honest I have never had to use them up until now.
You should only implement something in your program if there's need to, it's not because you've the possibility to do something, that you... |
Forum: C++ Jun 24th, 2009 |
| Replies: 3 Views: 792 >Memory is deleting here???...what is happening....?
Well, my eyesight is not good enough to see your code from here :P
Could you post it please? |
Forum: C++ Jun 20th, 2009 |
| Replies: 5 Views: 1,451 Please don't mind reading my previous post, just read this article:
http://notepad-plus.wiki.sourceforge.net/NppExec+Compiler+Guide :P |
Forum: C++ Jun 12th, 2009 |
| Replies: 13 Views: 15,588 >It's a legitimate question. Are you really trying to accomplish something by flaming the guy, or just being an ass?
I didn't want to blame anyone, Narue, but didn't you once write the following?
... |
Forum: C++ Jun 11th, 2009 |
| Replies: 16 Views: 743 >And I've read that you should use sizeof to determine the size of a byte?
No, you read it wrong, a byte is a general term for any valid combination of eight bits (and a bit is a one or a zero)... |
Forum: C++ Jun 11th, 2009 |
| Replies: 13 Views: 15,588 >Can you please explain a little how you derived the formula c = c * (y - x) / (x + 1); ....just to get the idea of what steps to do in order to reach this formula
Dude, are we going the reinvent... |
Forum: C++ Jun 8th, 2009 |
| Replies: 6 Views: 366 To the OP:
> // paste code here
We aren't going to post free code for you, however we can help you to accomplish the more tricky parts, give us a thorough problem description (not just: My... |
Forum: C++ Jun 3rd, 2009 |
| Replies: 4 Views: 254 What??
Edit:: Your (unformatted) code looks much more like C than like C++ ! |