Congrats, now you don’t need to rename this topic to “I chose C# instead of Python”. ![]()
#include iosream should be #include <iostream>.
using namespace std; like this is frowned upon. It dumps everything from the standard library into the current scope, which causes namespace pollution, naming conflicts, etc.
You should instead only use it in the scope of a function or method – here main() –, or even better use fully qualified names (e.g. std::string) or “import” only what you need (e.g. using std::string;).
You should also note that std::endl forces a flush of the output buffer, which is relatively expensive and rarely needed. It’s better to use the newline character \n, for instance std::cout << "your name\n";.
Furthermore, if the character size is fixed, I’d use a const char* name = "Edward"; (i.e. constant character pointer) instead of a std::string for performance reasons.
std::string, much like other dynamic containers, comes with some overhead, because it can be resized. Generally speaking, internally it has a certain size (capacity) and when it requires more space for new characters, it needs to copy everything to a new larger chunk of memory (expensive). This has the benefit of being “dynamic”, but comes at a cost.
For your case this doesn’t really matter, but it’s something to be aware of. The same goes for std::vector for instance.
You can also auto-format code here by putting it between ```code```, so that it doesn’t look like a mess.