#include <stdio.h>
void removerEspacosEsquerda(char string[]) {
int cont = 0;
for (int i = 0; string[i] != '\0'; i++, cont++) {
if (string[i] == ' ') cont--;
else string[cont] = string[i];
}
string[cont] = '\0';
}
int main() {
char string[] = " teste";
removerEspacosEsquerda(string);
}
//https://pt.stackoverflow.com/q/344240/101
I2luY2x1ZGUgPHN0ZGlvLmg+Cgp2b2lkIHJlbW92ZXJFc3BhY29zRXNxdWVyZGEoY2hhciBzdHJpbmdbXSkgewoJaW50IGNvbnQgPSAwOwogICAgZm9yIChpbnQgaSA9IDA7IHN0cmluZ1tpXSAhPSAnXDAnOyBpKyssIGNvbnQrKykgewogICAgICAgIGlmIChzdHJpbmdbaV0gPT0gJyAnKSBjb250LS07CiAgICAgICAgZWxzZSBzdHJpbmdbY29udF0gPSBzdHJpbmdbaV07CiAgICB9CiAgICBzdHJpbmdbY29udF0gPSAnXDAnOwp9CgppbnQgbWFpbigpIHsKICAgIGNoYXIgc3RyaW5nW10gPSAiIHRlc3RlIjsKICAgIHJlbW92ZXJFc3BhY29zRXNxdWVyZGEoc3RyaW5nKTsKICAgIHByaW50ZigiJXMiLCBzdHJpbmcpOwp9CgovL2h0dHBzOi8vcHQuc3RhY2tvdmVyZmxvdy5jb20vcS8zNDQyNDAvMTAx