C++ : what is :: for? -


if go accepted answer of post

could please elaborate on why uses:

double temp = ::atof(num.c_str()); 

and not simply

double temp = atof(num.c_str()); 

also, considered practice use syntax when use "pure" global functions?

it says use global version, not 1 declared in local scope. if someone's declared atof in class, this'll sure use global one.

have @ wikipedia on subject:

#include <iostream>  using namespace std;  int n = 12;   // global variable  int main() {     int n = 13;   // local variable     cout  << ::n << endl;  // print global variable: 12     cout  << n   << endl;  // print local variable: 13 } 

Comments

Popular posts from this blog

angular - Ionic slides - dynamically add slides before and after -

minify - Minimizing css files -

Add a dynamic header in angular 2 http provider -