|
|
Did you not believe me the first time I said it here/
"Old age is like a bank account. You withdraw later in life what you have deposited along the way." - Unknown
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
|
|
|
|
|
|
Did you investigate after my previous reply [^] ?
Why don't you provide more information if what I suggested is not what you are looking for ?
|
|
|
|
|
Sorry Mr. Cedric
~~~~~~~~~~~~~Raju~~~~~~~~~~~~~
|
|
|
|
|
Is there any samples for implement OCR Concept ..??
Thanks!!!!!11
~~~~~~~~~~~~~Raju~~~~~~~~~~~~~
|
|
|
|
|
rajugis, this is at least the 10th thread i've seen you make in the past week where you've asked for some obscure function or technique, having shown absolutely no attempt at solving the problem yourself. If you don't try and find a solution on your own, then nobody else will bother helping you to find one.
|
|
|
|
|
Hi,
Some where I read that when we don't have the efficient size for a data type we can increase this one by using operator overloading.
For example he is saying that a integer is having 2 bytes of memory occupancy by using operator overloading he says that he can increase this memory into 4 byte. Is it really possible like in this approach.
Any one please show me the correct path for this.
sampath-padamatinti
|
|
|
|
|
By operator overloading?! No. Maybe a pragma pack.
And what do you mean by 'an efficient size for a data type', pray tell?
Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p
|
|
|
|
|
sampath-padamatinti wrote: don't have the efficient size for a data type
What does this mean?
That the size is inefficient? In what way; not 32-bit aligned?
What kind of data type are you referring to? Classes?
sampath-padamatinti wrote: we can increase this one by using operator overloading
Well, it depends...
The code size will of course be bigger, but the size of the object will remain.
You may increase the size of an object by adding one or more virtual functions as the virtual table is part of the object, but this has nothing to do with efficiency.
"It's supposed to be hard, otherwise anybody could do it!" - selfquote "High speed never compensates for wrong direction!" - unknown
|
|
|
|
|
Don't bother about.
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
Hi,
class Client;
Client(const Client&);
The above code compiles fine with VSC++6.0, when same is compiled with VSC++ 2008 throw’s the following is the compilation error "error C4430: missing type specifier - int assumed. Note: C++ does not support default-int"
Then I have changed the code as below, it got compiled with VSC++ 2008.
Client(const &Client);
So can any one help me what is the cause of the problem and whether this "Client(const &Client); " is correct approach.
Thanks,
Nandu
modified on Friday, September 18, 2009 7:48 AM
|
|
|
|
|
What is that code even meant to mean? You've forward declared a class (Client), then what looks a bit like a constructor for that class. Doesn't make sense.
Oh - and VS2008 is complaining because you haven't specified a return type for what looks like a function declaration of a function called Client.
Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p
|
|
|
|
|
Thanks, I got the answer.
In VS6.0 Client(const &Client); compiles fine, where as in VS2008 it throws compilation error.
For VS2008 it should be Client(const Client&); - For copy con
-Nandu
|
|
|
|
|
So…lets look at the code you posted:
class Client;
Client(const Client&);
and what (judging by your answer) you should have posted:
class Client
{
Client(const &Client);
};
Your original code was syntactically incorrect and at the same time had the syntax (const Client&) that you now report as fixing the problem. If you're going to post problems with a code snippet, at least make it an accurate code snippet...
Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p
|
|
|
|
|
Hi to all,
Thanks everyone for my previous doubt. Here's is one more.
Sometimes, we say (when it comes to the basic difference between class and object) that class is a logical entity and object is a physical entity. But actually is it so? We still can use the size of operator to check the size right...and it gives some sizes.
If I make sense, what should be the correct statements?
Also please tell in t=context of static member function in a class
Thanks in advance
-----------------------------
I am a beginner
|
|
|
|
|
Think of the int datatype.
That is also logical.
It's only when you create a variable like int i; does it becomes physical.
But you can always take the size of int using sizeof(int) .
classes and objects are very similar.
The size of a class is the total size of the non-static data members of the class.
When static is used in a class, those elements are actually global but the scope of it is limited to the class.
The size will also include hidden elements like the virtual table pointer etc.
«_Superman_»
I love work. It gives me something to do between weekends.
|
|
|
|
|
thanks
I got that.
So,what i understood is , the result of the Sizeof operator is the amount of space that the variable of that type(int/class) will contain. So even though iit is not physical we get the results of sizeof.
But does the class resides on memory? when we say its not physical, it shouldn't exist in the memory right.Please correct me, if i am wrong.
-----------------------------
I am a beginner
|
|
|
|
|
hrishiS wrote: But does the class resides on memory? when we say its not physical, it shouldn't exist in the memory right.
You may say it is metaphysical...
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
No, the class does not reside anywhere.
It is only used by the compiler to create an object.
All class data members are referenced using offsets from the begining.
All class methods are actually global functions.
The functions get the address of the object through the ECX register (at least when compiled with Visual Studio). Or this could be passed in as a hidden first parameter.
To locate the data members, this object address is then added to the offsets.
When you do a new MyClass; what happens internally is malloc(sizeof(MyClass));
If you simply create a class and don't use it, it will never have a life.
«_Superman_»
I love work. It gives me something to do between weekends.
|
|
|
|
|
Hi, object is physical entity and allocation of memory is done based on the variables which we are using in that class. Suppose I used 2 integer variables and 1 float variable in my class then each object for this class occupies (2+2+4)bytes of memory. You can able to see this by using sizeof(object name) then it will gives you 8 bytes as a output. This result may vary based on the compiler used I am giving this based on the TC(turbo C)
And coming to the static variable is never possible to create inside a class. Because for a static variable the memory is allocated at compile time where memory allocated for an object at run time. So both things are contradict. When ever you tried to create an static variable inside a class it will gives you an error.
sampath-padamatinti
|
|
|
|
|
I am new to VC8 and simply cannot find how to change fonts and colors of the source code editor. Any hints?
Thanks
uli
|
|
|
|
|
tools->options->Environment->Font and colors
|
|
|
|
|
what is the use of STL ??
~Raju~~
|
|
|
|
|
rajugis wrote: what is the use of STL ??
It depends on your background.
(as a start, you may have a look here)
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|