我如何将此C语言语法转换为C

how can I translate this c language syntax into c++

本文关键字:语言 语法 转换      更新时间:2023-10-16

如何将此C语法转换为C ?

int age=19;
printf("my age is %d years old", age); 

这是使用Crt的C 。

但是您可以使用Cout ...

int age = 19;
cout << "my age is " << age << " years old":

//首先包含标头文件

#include <iostream>

//然后写下您的代码

   cout << "my age is : " << str;
   cout << "years old" << endl;