I’d like to know if there is a function in C to create an ID-like string (“account”) from a string (“name”) or two strings (“name”, “surname”) passed by argument.
The point is that I want to create an account with a pseudo-surname.
Any ideas to help me?
If there is no function to do that, I’d like to know the better way to do this. Thanks.
Variable name are defined at compile time. You can’t generate dynamically a variable name and reference it. If you want to achieve something similar you can implement a Map, where the key is a string with your variable name.
the code could be something like that: