Re[8]: string без пробела
От: Анатолий СССР  
Дата: 10.09.02 10:42
Оценка:
#include <string>
#include <iostream>
#include <algorithm>

using namespace std;

void main()
{
   const char *array = "Hello! World! \n";

   // копируем array в s
   string s = string(array);

   // удаляем пробелы
   s.erase(remove(s.begin(),s.end(),' '), s.end());

   cout << array;
   cout << s << '\n';
}
 
Подождите ...
Wait...
Пока на собственное сообщение не было ответов, его можно удалить.