Why no boundry condition set for C++
-
What is the main reason even till day-today there is no boundry condition set for C++. Why not compiler resist that we are pointing something out of the range of our array or we are pointing to a memory location which we cannot points to as it is not in the allowed range of our source code. Why not C++ creator or the IOS committee which build the standard put a check on this thing. There must be some reason of this freedom to point anywhere. I want to know that reason why they are doing like this. If a person like bjarne stroustrup can write such an advance programming language then there must be something special he left this imporant check to move in memory anywhere. If you know about this please share with me. I am curious to know the logic behind it. I asked this question from my teacher but instead of answering me he said this is not a part of my course :( I am new student to programming
-
What is the main reason even till day-today there is no boundry condition set for C++. Why not compiler resist that we are pointing something out of the range of our array or we are pointing to a memory location which we cannot points to as it is not in the allowed range of our source code. Why not C++ creator or the IOS committee which build the standard put a check on this thing. There must be some reason of this freedom to point anywhere. I want to know that reason why they are doing like this. If a person like bjarne stroustrup can write such an advance programming language then there must be something special he left this imporant check to move in memory anywhere. If you know about this please share with me. I am curious to know the logic behind it. I asked this question from my teacher but instead of answering me he said this is not a part of my course :( I am new student to programming
-
You should ask Bjarne Stroustrup[^].
If you don't know the answer by ur-self then keep quite.
-
What is the main reason even till day-today there is no boundry condition set for C++. Why not compiler resist that we are pointing something out of the range of our array or we are pointing to a memory location which we cannot points to as it is not in the allowed range of our source code. Why not C++ creator or the IOS committee which build the standard put a check on this thing. There must be some reason of this freedom to point anywhere. I want to know that reason why they are doing like this. If a person like bjarne stroustrup can write such an advance programming language then there must be something special he left this imporant check to move in memory anywhere. If you know about this please share with me. I am curious to know the logic behind it. I asked this question from my teacher but instead of answering me he said this is not a part of my course :( I am new student to programming
Hassan Syed1 wrote:
What is the main reason even till day-today there is no boundry condition set for C++.
It is by design, just like with C, its ancestor language. You, as a programmer, are responsible to do all the checking manually. May be you should ask Brian Kernighan and Dennis Ritchie. The C Programming Language - Wikipedia, the free encyclopedia[^] The C++ Programming Language - Wikipedia, the free encyclopedia[^]
Patrice “Everything should be made as simple as possible, but no simpler.” Albert Einstein
-
What is the main reason even till day-today there is no boundry condition set for C++. Why not compiler resist that we are pointing something out of the range of our array or we are pointing to a memory location which we cannot points to as it is not in the allowed range of our source code. Why not C++ creator or the IOS committee which build the standard put a check on this thing. There must be some reason of this freedom to point anywhere. I want to know that reason why they are doing like this. If a person like bjarne stroustrup can write such an advance programming language then there must be something special he left this imporant check to move in memory anywhere. If you know about this please share with me. I am curious to know the logic behind it. I asked this question from my teacher but instead of answering me he said this is not a part of my course :( I am new student to programming
You are assuming that there are ordered limits to the set and that boundary has meaning. In a nutshell you seem to be inferring that sets are something like ordered numbers. It's a construction class so lets expand it to the general form, I have a set I called animals in which I inserted an chicken, a pig and a dog. I now have a Lion is this inside or outside the boundary condition of my animal set? Do you see the problem with your question? What if I told you that my animal set was domestic animals does that change your answer? Do you get that even if I have a set of numbers in a generic set, those numbers are just place holders for "things" such as animals ... they aren't really numbers like you are using them. So you may want to review set theory Set theory - Wikipedia, the free encyclopedia[^] So the correct answer is if you want boundary conditions on your set because there is some logical order to them, then extend the class yourself. That behaviour is not natural to a generic set class so why would you expect it to be in a generic set class. Nobody has ever asked for that behaviour because it's wrong under set theory, as you are making some very specific sorted or ordered set.
In vino veritas
-
What is the main reason even till day-today there is no boundry condition set for C++. Why not compiler resist that we are pointing something out of the range of our array or we are pointing to a memory location which we cannot points to as it is not in the allowed range of our source code. Why not C++ creator or the IOS committee which build the standard put a check on this thing. There must be some reason of this freedom to point anywhere. I want to know that reason why they are doing like this. If a person like bjarne stroustrup can write such an advance programming language then there must be something special he left this imporant check to move in memory anywhere. If you know about this please share with me. I am curious to know the logic behind it. I asked this question from my teacher but instead of answering me he said this is not a part of my course :( I am new student to programming
It sounds an awful lot like you're asking - why does a fast and powerful language like C++ not have one of the performance killers of languages that require less skill to use. Simply, because with C/C++ you're given the power to shoot yourself in the foot. If you do so, it's your own stupid fault, not that of the language that lets you do it. If you have an array of a million elements and you wish to access each of them, you're expected to know that you're not trying to access an element before or after your allocated memory. The alternative is to assume you have or will screw-up and to perform 1 million bounds checking operations. No - that's not cool. That's a nice feature for sub-par programmers. Also, hassan syed1 - it's Bjarne Stroustrup, not bjarne stroustrup. You capitalized your own name but thought his not significant enough to afford him the same respect?
-
What is the main reason even till day-today there is no boundry condition set for C++. Why not compiler resist that we are pointing something out of the range of our array or we are pointing to a memory location which we cannot points to as it is not in the allowed range of our source code. Why not C++ creator or the IOS committee which build the standard put a check on this thing. There must be some reason of this freedom to point anywhere. I want to know that reason why they are doing like this. If a person like bjarne stroustrup can write such an advance programming language then there must be something special he left this imporant check to move in memory anywhere. If you know about this please share with me. I am curious to know the logic behind it. I asked this question from my teacher but instead of answering me he said this is not a part of my course :( I am new student to programming
It does offer boundary condition, just use modern C++ constructs (vector, array, string...) instead of their unsafe C equivalent (pointers, char*...) If you are using a modern version of Visual Studio, there are additional checks made by the compiler and runtime to check boundary conditions (Security Features in the CRT[^]) and also they offer a set of safer runtime API (all the _s functions like strcpy_s instead of strcpy) Remember that if the language let you shoot yourself in the foot, there is no excuse try not to by following best practice when coding.
I'd rather be phishing!