Which of these is a difference between C++ and Ruby?
A) Ruby’s compiler verifies all assert statements (or the Ruby equivalent) at compile time.
B) Ruby does not require a variable to have the same data type throughout the program.
C) Ruby has a string class built in.
D) Ruby has BGI graphics built in (so that #include
Up to my knowledge ruby on rails is used as server side scripting like php, c++ is a powerful programming language.
B) Ruby does not require a variable to have the same data type throughout the program. Ruby variables are simply names or tags you assign to objects, and the type really depends on the type of object you assign to it. http://www.techotopia.com/index.php/Understanding_Ruby_Variables#Identifying_a_Ruby_Variable_Type
compared to C++'s variables, ruby variables are dynamically typed.
Join our real-time social learning platform and learn together with your friends!