this is the first time when i use linq expresions and i like more than second version, i think that are more intuitive. About changes, i think that is easier to change second version because all code is more spaceful, i'm sure you understand what i mean. And the answer for third question, i think that is important how another programmer start, if he start with linq it will be easier for him to understand linq and if he start using functions without linq expressions is easier to understand second versions. I like both methods and i think that is important to know many methods for solving a task
very very nice, could you tell me a way to learn c#? i make challanges but i don't know many basics of c#, for example one year ago i made a program with incapsulation, but i didn't know name of method, after many months i found that it is a basic OOP method and so on. I don't know, in my country i don't have teachers for C#, and it is very hard for me to learn.
One of my old friends, Mihai Chis [^], is a world-class C# programmer in Bucharest, and I bet there are other resources. In Bulgaria, a group of C# programmers published an excellent, free, guide to programming in C# (English available): [^].
You can search CP for recommendations on other books by several people, including me: [^]
«Where is the Life we have lost in living? Where is the wisdom we have lost in knowledge? Where is the knowledge we have lost in information?» T. S. Elliot
Coding discussions like these brings up the nostalgia in me, about the old days of Pascal, where array indexes could be of arbitrary discrete types, arbitrary lower and upper limits. Like an array indexed from 'a' through 'z'.
And also: Discrete types have a natural ordering, not because they "really are integers", because they are not. Succ('a') is 'b', without casting to int, increment and cast back. Wednesday follows Tuesday. And so on.
Proper handing of enums and discrete subrange types is near the top of my wish list for future C# versions. They could do it in Pascal 49 years ago; it should be possible to do in C# today. But it seems like I am the only one missing it. (Or maybe: One of the very few to know that once it existed.)
The default precision to which doubles are printed is different in C++ and C#, so they might actually be the same, can't tell from this. They might also be different, depending on some funny combination of one program being 32bit (and defaulting to the x87 FPU and 80bit computation followed by a conversion to 64bit) and the other 64bit (and defaulting to SSE2 and 64bit computation), I'm not sure if that actually makes a difference here.. If you reinterpret the bits as an int64 and print that we could be sure.
Thank you very much! You are right, having a look at both results as int64 shows, that both results are exactly the same.
Thank a lot again!
More and more I recognize I'm becoming older...
To my shame, I must confess that the above described observations were made only by observing the debugger display.
I think ten years ago I would also have come up with the idea to compare the results binary
It does not solve my Problem, but it answers my question