Skip to main content

Da pra você formatar a string caractere por caractere.

Exemplo:

#include <iostream><stdio.h>
#include <cstdio><stdlib.h>
#include <cstdlib>

using namespace std;<string.h>

int main() {
    stringchar ss[] = "1444771699,Andre Alves,SAQUE,-500.00,,200";
    int qtd = 1;

    printf("string %d: ", qtd);
    for (int i = 0; i <  s.lengthstrlen(s); i++){
        if ( s[i] != ',')
            printf("%c", s[i]);
        else if ( s[i] == ',') {
            qtd++;
            printf("\nstring %d: ", qtd);
        }
    }
    return 0;
}

Da pra você formatar a string caractere por caractere.

Exemplo:

#include <iostream>
#include <cstdio>
#include <cstdlib>

using namespace std;

int main() {
    string s = "1444771699,Andre Alves,SAQUE,-500.00,,200";
    int qtd = 1;

    printf("string %d: ", qtd);
    for (int i = 0; i <  s.length(); i++)
        if ( s[i] != ',')
            printf("%c", s[i]);
        else if ( s[i] == ',') {
            qtd++;
            printf("\nstring %d: ", qtd);
        }

    return 0;
}

Da pra você formatar a string caractere por caractere.

Exemplo:

#include <stdio.h>
#include <stdlib.h>
#include <string.h>

int main() {
    char s[] = "1444771699,Andre Alves,SAQUE,-500.00,,200";
    int qtd = 1;

    printf("string %d: ", qtd);
    for (int i = 0; i <  strlen(s); i++){
        if ( s[i] != ',')
            printf("%c", s[i]);
        else if ( s[i] == ',') {
            qtd++;
            printf("\nstring %d: ", qtd);
        }
    }
    return 0;
}
Formatação e correções.
Fonte Link
gato
  • 23,7mil
  • 33
  • 125
  • 255

Da pra você formatar a string caractere por caractere. Exemplo

#include <iostream>
#include <cstdio>
#include <cstdlib>

using namespace std;

int main() {
    string s = "1444771699,Andre Alves,SAQUE,-500.00,,200";
    int qtd = 1;

    printf("string %d: ", qtd);
    for (int i = 0; i <  s.length(); i++)
        if ( s[i] != ',')
            printf("%c", s[i]);
        else if ( s[i] == ',') {
            qtd++;
            printf("\nstring %d: ", qtd);
        }

    return 0;
}
Exemplo:

 
#include <iostream>
#include <cstdio>
#include <cstdlib>

using namespace std;

int main() {
    string s = "1444771699,Andre Alves,SAQUE,-500.00,,200";
    int qtd = 1;

    printf("string %d: ", qtd);
    for (int i = 0; i <  s.length(); i++)
        if ( s[i] != ',')
            printf("%c", s[i]);
        else if ( s[i] == ',') {
            qtd++;
            printf("\nstring %d: ", qtd);
        }

    return 0;
}

Da pra você formatar a string caractere por caractere. Exemplo

#include <iostream>
#include <cstdio>
#include <cstdlib>

using namespace std;

int main() {
    string s = "1444771699,Andre Alves,SAQUE,-500.00,,200";
    int qtd = 1;

    printf("string %d: ", qtd);
    for (int i = 0; i <  s.length(); i++)
        if ( s[i] != ',')
            printf("%c", s[i]);
        else if ( s[i] == ',') {
            qtd++;
            printf("\nstring %d: ", qtd);
        }

    return 0;
}

 

Da pra você formatar a string caractere por caractere.

Exemplo:

#include <iostream>
#include <cstdio>
#include <cstdlib>

using namespace std;

int main() {
    string s = "1444771699,Andre Alves,SAQUE,-500.00,,200";
    int qtd = 1;

    printf("string %d: ", qtd);
    for (int i = 0; i <  s.length(); i++)
        if ( s[i] != ',')
            printf("%c", s[i]);
        else if ( s[i] == ',') {
            qtd++;
            printf("\nstring %d: ", qtd);
        }

    return 0;
}
Fonte Link

Da pra você formatar a string caractere por caractere. Exemplo

#include <iostream>
#include <cstdio>
#include <cstdlib>

using namespace std;

int main() {
    string s = "1444771699,Andre Alves,SAQUE,-500.00,,200";
    int qtd = 1;

    printf("string %d: ", qtd);
    for (int i = 0; i <  s.length(); i++)
        if ( s[i] != ',')
            printf("%c", s[i]);
        else if ( s[i] == ',') {
            qtd++;
            printf("\nstring %d: ", qtd);
        }

    return 0;
}