I am attempting to run a code that takes a user inputted standard time and convert it to military time. For the user input, the hours can be typed as one or two digits, and AM/PM can be typed in any way. Given that, the code I have is as follows:
#include <iostream>
#include <string>
using namespace std;
string time, hour, minute, amPm, miltime;
char amPmCheck;
int main()
{
    cout<<"Enter time:\n";
    cin>>time;
    colon = time.find(':');
    space = time.find (' ');
    hour = time.substr(0, colon);
    minute = time.substr(colon + 1, space);
    amPm = time.substr(space, back);
    amPmCheck = amPm[0];
    timeConversion(hour, minute, amPmCheck);
    return 0;
}
void timeConversion(hour, minute, amPmCheck)
{
    if(amPmCheck == 'a'||'A')
    {
        if(int(hour) == 12)
        {
            hour.assign('00');
        }
        else if (int(hour) <= 9)
        {
            hour.insert(0, '0');
        }
    }
    else
        if(int(hour) < 12)
        {
            hour.assign(12+int(hour));
        }
    miltime = hour + minute
    cout<< "Corresponding military time is", miltime;
}
However when attempting to compile the code, I get the following errors from my chosen compiler:
main.cpp:50:25: warning: multi-character character constant [-Wmultichar]
             hour.assign('00');
                         ^~~~
main.cpp:15:8: error: 'std::string time' redeclared as different kind of symbol
 string time, hour, minute, amPm miltime;
        ^~~~
In file included from /usr/include/pthread.h:24:0,
                 from /usr/include/x86_64-linux-gnu/c++/6/bits/gthr-default.h:35,
                 from /usr/include/x86_64-linux-gnu/c++/6/bits/gthr.h:148,
                 from /usr/include/c++/6/ext/atomicity.h:35,
                 from /usr/include/c++/6/bits/ios_base.h:39,
                 from /usr/include/c++/6/ios:42,
                 from /usr/include/c++/6/ostream:38,
                 from /usr/include/c++/6/iostream:39,
                 from main.cpp:10:
/usr/include/time.h:192:15: note: previous declaration 'time_t time(time_t*)'
 extern time_t time (time_t *__timer) __THROW;
               ^~~~
main.cpp:44:21: error: variable or field 'timeConversion' declared void
 void timeConversion(hour, minute, amPmCheck)
                     ^~~~
main.cpp:44:35: error: 'amPmCheck' was not declared in this scope
 void timeConversion(hour, minute, amPmCheck)
                                   ^~~~~~~~~
I am still relatively new to programming, so any information on what my mistakes are and what the simplest way to fix them is would be appreciated.
 
     
    