0

as a self-study student I want to know the differences between two language features in c# and c++, I want to know by a simple example if someone know that please share it with me.

Rebwar
  • 413
  • 3
  • 17
  • 3
    Google "generics vs templates" and this is the second result: https://learn.microsoft.com/en-us/dotnet/csharp/programming-guide/generics/differences-between-cpp-templates-and-csharp-generics The information is out there and well-discussed. If you have a specific question about the differences, ask it, but this is too broad. – madreflection Feb 18 '20 at 19:03
  • https://stackoverflow.com/help/dont-ask – Hamed Moghadasi Feb 18 '20 at 19:07
  • 1
    Does this answer your question? [What are the differences between Generics in C# and Java... and Templates in C++?](https://stackoverflow.com/questions/31693/what-are-the-differences-between-generics-in-c-sharp-and-java-and-templates-i) – Hamed Moghadasi Feb 18 '20 at 19:08
  • actually I read this doc, but there are no good points to know really what the difference is? – Rebwar Feb 18 '20 at 19:08
  • In addition to all of the differences stated at that Microsoft article linked above, consider the underlying mechanisms. Generics are an integral part of the .NET language infrastructure; no such equivalency exists for Templates. Templates are essentially a very sophisticated form of **language macros.** – Robert Harvey Feb 18 '20 at 19:10
  • @HamedMoghadasi in this post most answers about java and c++ template, I try to google and find something better, tnx – Rebwar Feb 18 '20 at 19:13
  • 1
    Have a look here: https://www.geeksforgeeks.org/templates-cpp/ – Robert Harvey Feb 18 '20 at 19:13
  • 1
    and here: https://www.geeksforgeeks.org/c-sharp-generics-introduction/ – Robert Harvey Feb 18 '20 at 19:14

0 Answers0