Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

Namespaces (use translatetor)

Name: Anonymous 2011-06-04 5:29

Hi,

Mainstream in other languages ​​(refer to: Java, PHP, python, perl, C + +) There vivid language to improve to make the new language version, annoying to fix problems or stolen from thoughts of others efforts. Why is it like in C? Why is C so taste bad? I mean, I know C and Unix and all so big and old, but they like, why not come to add namespaces?

Name: Anonymous 2012-08-12 11:59

Implying there are no namespaces in C.
Check this: http://en.wikipedia.org/wiki/Namespace#Namespaces_in_Programming_Languages
And then check this:
#include <stdio.h>
#define namespace struct

namespace {
    int boxSide;
} Box1;
 
namespace {
    int boxSide;
} Box2;
 
int main () {
    int boxSide = 42;
    Box1.boxSide = 4;
    Box2.boxSide = 12;
    printf("%d\n", Box1.boxSide); //output 4
    printf("%d\n", Box2.boxSide); //output 12
    printf("%d\n", boxSide);      // output 42
    return 0;
}

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List