Setting string value to int

I'm having this error when ever I do this, string = int;
error: conversion from 'int' to non-scalar type 'std::string {aka std::basic_string}' requested

Is there any way to set the value of a string to the value of a specific integer?
How would you also do a long list of adding on to a string
string1 + "," + string2 + "," + string3 + "," // so on and so fourth
Last edited on
Wait I figured it out

1
2
3
4
   int test = 90;
    std::string s = std::to_string(test);
    s = s + "|" + s + "|" + s + "|" + s + "|";
    cout << s << endl;
Topic archived. No new replies allowed.