阅读背景:

如何将(int)字符串存储到int数组中

来源:互联网 
int ascii[1000] = {0};
string *data = (string*)malloc ( 1000*sizeof( string));
char *text = (char*)malloc ( 1000 *sizeof( char));
cout << "Enter the first arrangement of data." << endl;
cin.getline(text, 1000);
char *token = strtok(text, " ");

while ( token != NULL )
{
    if ( strlen(token) > 0)
    {
        cout << "The tokens are: " << token << endl;
        data[Tcount++] = *token;

    }
    token = strtok(NULL, " ");

    for(i=0; i < (Tcount); i++)
      {
          ascii[i] = (int)data[i]; // error here
      }
int ascii[1000] = {0};
string *data = (string*)



你的当前访问异常,请进行认证后继续阅读剩余内容。

分享到: