我可以在C程序中使用cstdio吗? [英] Can I use cstdio in a C program?

查看:196
本文介绍了我可以在C程序中使用cstdio吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我向C程序添加 #include< cstdio>
时,我在cstdio中遇到了大量错误。

I get a ton of errors in cstdio when I add #include <cstdio> to the C program.

c:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\include\cstdio(17) : error C2143: syntax error : missing '{' before ':'
c:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\include\cstdio(17) : error C2059: syntax error : ':'

谢谢

编辑 - 我想使用 snprintf ,这就是为什么我要尝试包含它。

EDIT - I would like to use snprintf, which is why I am trying to include this.

推荐答案

你想要 #include< stdio.h> cstdio 是C头的C ++包装器。

You want #include <stdio.h>. cstdio is the C++ wrapper for the C header.

编辑: MSVC仅支持C99中构成C ++子集的元素。

MSVC only supports the elements in C99 that form a subset of C++.

此网站的C实施 snprintf()根据GPL许可。

This site has a C implementation of snprintf() licensed under the GPL.

这篇关于我可以在C程序中使用cstdio吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆