There are different ways, there is one straight forward though. For instance you have a variable of type char: var1. And you want to convert it to another variable of type int: var2. You can use casting for it:
var2 = (int) var1;
You have to be very careful using casting because it cause buffer overflow. Newer versions of C have many different function to assure correctness of parsing, for instance, TryToParse...
Copyright © 2026 eLLeNow.com All Rights Reserved.