char string[] = "1234"; // The string you want to convert to size_t. size_t i; sscanf(string, "%zu", &i); // i == 1234