Why would you write :: with no preceding namespace? (e.g. ::atof) [duplicate]

It says use the global version, not one declared in local scope. So if someone’s declared an atof in your class, this’ll be sure to use the global one.

Have a look at Wikipedia on this subject:

#include <iostream>

using namespace std;

int n = 12;   // A global variable

int main() {
    int n = 13;   // A local variable
    cout  << ::n << endl;  // Print the global variable: 12
    cout  << n   << endl;  // Print the local variable: 13
}

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)