What does this do ?

What does this do ?
int Next_operator(char* expr, unsigned long length, unsigned long& currpos, char* Operator)..the highlighted things

if( ::isdigit(expr[currpos]) )....the 4 points..
Last edited on
1) if you mean pointers: http://cplusplus.com/doc/tutorial/pointers/
2) it's the scope operator. If you supply a class on the right size, it returns the left side on its scope. So:

1
2
3
4
5
class A
{
	public:
		int a;
};

To access the a variable from class A, you use A::a. Without anything on the right side, its effect is returning the left side on the global scope:

1
2
3
4
5
6
7
8
int a;

class A
{
	public:
		int a;
		int f() { ::a++; }
};

Without using ::, there is no way you could access the global a.
the program i'm refering to does not involve classes and objects...
Last edited on
It refers to global namespace.
Topic archived. No new replies allowed.