TOPIC

why compilation error with c++17???????

rsnirob asked 4 months ago

#include<iostream>
#include<cstring>
#include<cstdio>

using namespace std;

int main()
{
    int t;
    scanf("%d",&t);
    cin.ignore();
    while(t--)
    {
        char s[51];

        gets(s);

        char *token;
        token=strtok(s,". ");

        string msg="";
        while(token!='\0')
        {

            char x=token[0];
            msg.push_back(x);        

            token=strtok('\0',". ");
        }

        cout<<msg<<endl;

    }
}

This topic has not been answered yet. Be the first!

Remember not post solutions. Your post may be reviewed by our moderators.