#include <date/RDateTime>
int main(int argc, char *argv[])
{
RDateTime current = RDateTime::now;
fprintf(stdout, current.toS());
return 0;
}
First, Ruby's require 'date' is corresponding to #include <date/. Second, Ruby class/module DateTime is corresponding to RDateTime>, which is converted with prefix 'R'. Last, Ruby's snake_case method name(ex. to_s) is converted to camelCase method name(ex. toS()).
No comments:
Post a Comment