c** 中的 *char 转成pasal
时间: 2023-12-04 13:40:09 浏览: 35
为了将C语言中的*char转换为Pascal,我们需要使用Pascal中的字符串类型。在Pascal中,字符串类型是由字符数组表示的。因此,我们需要将C语言中的*char转换为字符数组,然后将其赋值给Pascal中的字符串类型变量。
以下是一个示例程序,演示了如何将C语言中的*char转换为Pascal:
```c
#include <stdio.h>
#include <string.h>
int main() {
char *c_str = "Hello, world!"; // C语言中的*char
char p_str[20]; // Pascal中的字符串类型变量
strcpy(p_str, c_str); // 将C语言中的*char复制到Pascal中的字符串类型变量中
printf("Pascal string: %s\n", p_str); // 输出Pascal中的字符串类型变量
return 0;
}
```
相关推荐
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![application/x-rar](https://img-home.csdnimg.cn/images/20210720083606.png)
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![rar](https://img-home.csdnimg.cn/images/20210720083606.png)
![application/x-gzip](https://img-home.csdnimg.cn/images/20210720083646.png)
![rar](https://img-home.csdnimg.cn/images/20210720083606.png)
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![rar](https://img-home.csdnimg.cn/images/20210720083606.png)