Hi!
When do I need to declare const method? And when to use const references?
Some pseudo-code examples will be just fine.
Thanks!
Type: Posts; User: GaPe
Hi!
When do I need to declare const method? And when to use const references?
Some pseudo-code examples will be just fine.
Thanks!
Hi!
If I delay my program for certain amount of milliseconds, how much CPU is used?
Yes, something like that. But, is that good programming?
Hi!
Anyone knows how can you make a group of methods in a .hpp file in C++?
And when you use this header file it looks like this ...
Support s;
Thanks for the replies!
"The array contains 3 Activity pointers ..."
That's what I meant. So that's cool.
for (int i = 0; i < tableLength - 1; i++)
{
Activity *act =...
Hi!
I have a few questions about ** (pointer to pointer).
Let's say I have a class named Activity.
I would code it like this ...
int tableLength = 3; // 2 from before and 1 new
Ok this works! Thanks.
But what about overloading this =>
int cal = 200;
char *text = "Result is " + calc;
How can I overload this?
I don't want to use templates. I want to overload.
All I want to do is this =>
int cal = 200
String s = "Result is " + calc;
And this code must produce a string which looks like this=> s = "Result is 200". I want to create java-like String...
Hi!
I want to overload operator +, so I can write strings in this way => String s = "Age: " + 20; // int, long and double
How am I supposed to do that?
What does this mean "void *&mem"? What's the trick?
Hi!
I know the meaning of the const in the parameter field but I don't know exactly what it means if you declared it after the parameter field.
bool find(const String &str) const; // what...
Thanks for the reply.
Can you give me an example for using UNICODE?
Hi!
I'm a little confused about deleting a variable in this case:
file String.hpp ...
...
class String {
public:
Thanks! It's working now.
How do I do that?
Hi!
I have another overloading operator problem.
I want to use my String class with type char.
Example:
String temp = "";
char z = 'a';
temp += z;
Thank you very much!
Hi!
I have a problem with overloading a [] operator. Whenever I want to assign value to a string I always get this message "error C2106: '=' : left operand must be l-value".
Example:
str[1] =...
Hi!
Can anyone, please, write me an example of initialization of double pointer with new?
char **tableOfStrings = new ...???
Thanks!
How am I supposed to define that friend method in .cpp file?
I already have this method "operator const char *() { return text; }" and it is not working. I still get the address instead of the actual text.
Any other suggestions?
I like pie...
Hi!
I have a class named String which contains member "char *text" and method "void print() const;".
Whenever i declare String class and i want to print that string on the screen i...
Yes, I know how to use resources. Thanks!
LoadImage works for the icon, which is inside the program. But I really need to use the resources if I want to have an iconic exe file.
Thank you for your help.