Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- String mystr = "";
- String original = "aaabb";
- char last = original.charAt(0);
- for (int i = 1; i < original.length(); i++) {
- // Some code not relevant
- mystr += last + "" + count; // Here is my doubt.
- }
- char mystr[1024];
- char * str = "abcdef";
- char c = str[1]; // will get 'b'
- int int_num = 100;
- sprintf(mystr, "%s%c%d", str, c, int_num);
- "abcdefb100"
- strcat(mystr, "xyz"); // now it is "abcdefb100xyz"
- char mystr[1024]; // Assuming the maximum string you will need is 1024 including the terminating zero
- char lastString[2];
- lastString[0] = last; // Set the current character from the for loop
- lastString[1] = '