Converting char array to an int array in c++ -
i have char array containing 3 2 4 56 1. need perform sorting function on elements of array (i have arrange them in ascending order), can't unless numeric. how can convert array int array?
actually, char array numeric:
char nums[] = {1, 5, 2, 6, 0}; std::sort(std::begin(nums), std::end(nums)); (auto = std::begin(nums); != std::end(nums); ++it) printf("%i ", *it);
Comments
Post a Comment