What's the difference between these two statements?
ob.A::ar[0] = 200;
ob.ar[0] = 200;
where ob
is an object of class A
class A
{
public:
int *ar;
A()
{
ar = new int[100];
}
};
A sentence is a group of words that usually have a subject, verb and information about the subject. Remember: A sentence can be a statement, question or command. A statement is a basic fact or opinion. It is one kind of sentence.
The difference between AND, OR is that AND evaluates both conditions must be true for the overall condition to be true. The OR evaluates one condition must be true for the overall condition to be true. In the OR result, if name is John then condition will be true. If any row has the age 22, then it will be true.
Key Differences Between This and That'This' can be used to refer to something which is just mentioned. Conversely, 'that' refers to something which is previously mentioned or implied. The plural form of the this is 'these', whereas 'those' is the plural form of that.
Questions, commands and advice are typically not statements, because they do not express something that is either true or false. But sometimes people use them rhetorically to express statements. We saw an example of a question which by itself is not a statement, but can be used to express a statement.
There is no difference. The explicit namespace qualification of ar
is redundant in this case.
It might not be redundant in cases where (multiple, nonvirtual) inheritance redefines the name ar
. Sample (contrived):
#include <string>
class A
{
public:
int *ar;
A() { ar = new int[100]; }
// unrelated, but prevent leaks: (Rule Of Three)
~A() { delete[] ar; }
private:
A(A const&);
A& operator=(A const&);
};
class B : public A
{
public:
std::string ar[12];
};
int main()
{
B ob;
ob.A::ar[0] = 200;
ob.ar[0] = "hello world";
}
See it on http://liveworkspace.org/code/d25889333ec378e1382cb5af5ad7c203
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With