机试小知识点(二)

    xiaoxiao2023-03-24  4

    知识点 1:

    char* ch = "123"; int a = atoi(ch);//字符串转换为整型 cout<<a<<endl;//123 int a2 = 456; char ch2[10]; itoa(a2, ch2, 10);//整型转换为字符串 cout<<ch2<<endl;//字符串456
    转载请注明原文地址: https://ju.6miu.com/read-1201206.html
    最新回复(0)