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

What would you change in C?

Name: Anonymous 2009-08-26 13:44

It's the time for the next revision of the C standard and for some reason they want your advice. What do you add, remove, rename, etc ?

Name: Anonymous 2010-04-30 9:36

Little thing with a few example includes I'd like to see:
Also, this is mostly taken from C++ and Python
/********
** ++C **
********/

// Types - string?
//    native comparison
string foo = "FOO!!!"
string bar = "BAR!!!"

if(foo == bar) { //True
   foo[0] = 'B'; // Still accessable as a char array
   printf("%s\n", foo);
}

if(foo < bar) { //False, 'O' > 'A'
   printf("LOL HIGHER\n");
} else if(foo != bar) {
   printf("Example Password: %s DENIED\n", bar);
}


// Types - bool
//    simple single-bit variable
bool example = 0; //1-bit taken
bool exampletable[20] = 0; //20-bits taken

// bool exampletwo = False;
// True and False are not keywords, only ints 0 and 1 for bools


// Single-line comments:
// just because of the useful


// Namespaces:
//  #insert <namespaces.cpp>
namespace lol {
   int epic_lulz;
}

lol::epic_lulz = 2;

using namespace lol;
epic_lulz = 9001;


// OOP
class board {
   init:
      // I like the 'init:' header, but this will
      //  need to be changed in order to work properly
      initclass(int boardCols, int boardRows) {
         int boardX = boardCols;
         int boardY = boardRows;
      }
        
   private: //As C++, but can use vars from init:
      int boardX;
      int boardY;
     
   public: //As C++, but can use vars from init:
      bool board[boardX][boardY];
     
}

class board gol(20, 30);
gol.board[18][2]

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