I'll like to convert my variable string into a integer:
Testing my code i notice I did something wrong.
#include <cs50.h>
#include <stdio.h>
#include <string.h>
int main(void)
{
string s = get_string("Name: ");
printf("%s\n %i\n", s, (int)s);
}
output:
Name: j
j
41127952
Name: j
j
40714256
I investigate the ASCII code and the value is 106. Why keeps outputting random numbers.