Time conversion from 12hr to 24hr format in C
There will somewhat struggle while converting the time in the 24hr format in string array or pointer. But the solution provided here will be very simple and easy to understand to convert time in C SAMPLE I/P 07:05:45PM O/P 19:05:45 SOLUTION: char* timeConversion(char* s) { // s is a string pointer which contains time format if(*(s+8) == 'P'){ int a = *(s+0) - 48; // integer a gets first digit in HR int b = *(s+1) - 48; // integer b gets second digit in HR int c = a*10 + b; // integer c is HR if(c!=12){ ...