what is meaning of typesafe in c++..........and what is type safety...........plese explain with examples
what is meaning of typesafe in c++..........and what is type safety...........plese explain with examples
Type safety is a concept from computer science (more specifically with programming language design and compiler design) not C++ specifically. C++ is one of several programming languages with features concerned with type safety.
Essentially, type safety refers to a collection of features of programming languages that permit a compiler to automatically detect programming errors in code by examining the types of data being acted on, reporting errors if mismatches occur, and (usually) refusing to build a program. If the compiler doesn't do this, the program is able to be built, shipped, and run ..... and errors that occur then are much harder (and expensive in terms of effort and time) for the programmer to track down and correct.
Have a look here. It describes type safety, and even includes some C++ examples.
Last edited by grumpy; 12-23-2013 at 07:42 AM. Reason: Fixed typos
"Owners of dogs will have noticed that, if you provide them with food and water and shelter and affection, they will think you are god. Whereas owners of cats are compelled to realize that, if you provide them with food and water and shelter and affection, they draw the conclusion that they are gods."
-Christopher Hitchens