how to convert an int to a char C++
<p>Im having trouble with an assignment where I have to convert three variables of a clock (int hour, int minutes, and bool afternoon) to be converted to a string in a method. I tried converting the int to a char and then replacing each string with the char. The function is suppose to return T/F if the conversion worked or not. Here is what I have so far:</p>

<pre><code>class Time
{
private:
  int hour;
  int minutes;
  bool afternoon;
public:
  void setHour(int hr);
  void setMinutes(int min);
  void setAfternoon(bool aft);

  int getHour();
  int getMinutes();
  bool getAfternoon();

  bool setAsString(string time);
  string getAsString();

  Time(void);
  ~Time(void);
};
</code></pre>

<p>and</p>

<pre><code>bool Time::setAsString(string time){
char min = minutes;
char hr = hour;

char hr[0] = time[0];
char hr[1]= time[1];
char min[0] = time[3];
char min[1] = time[4];
char afternoon = time[6];
if ((hourTens &gt; 1) || (minTens &gt; 5)) {
return false;
} else {
return true;
}
}
string Time::getAsString(){
return false;
}
</code></pre>
