dev/bash/xml/xmlstarlet/xmlattrsort.cpp

31 lines
449 B
C++
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

#include <cstdlib>
#include <stdio.h>
#include <string>
#include <iostream>
using namespace std;
int main(int argc, char *argv[]) {
/*
* Читаем xml файл в переменную xml
*/
string xml;
char c;
while ((c = getc(stdin)) != EOF)
xml += c;
/*
* В цикле просматриваем всю xml
*/
for (size_t i = 0, max_i = xml.length(); i < max_i; i++) {
cout << xml[i];
}
return EXIT_SUCCESS;
}