C没有一个布尔值?另外VS2010的问题 [英] C doesn't have a bool? Also VS2010 question

查看:245
本文介绍了C没有一个布尔值?另外VS2010的问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用VS 2010专业版。

I'm using VS 2010 Pro.

首先,C没有bool类型?我只需要使用INT与0/1。似乎很奇怪,因为大多数语言考虑布尔标准型。

First, C doesn't have a bool type? I just have to use int with 0/1. Seems odd as most languages consider boolean a standard type.

此外,我的Visual Studio 2010专业版,但没有一个C计划。我刚刚创建一个空的C ++项目。文件名以.c结尾

Also I have Visual Studio 2010 Pro but doesn't have a "C Project". I just created an Empty C++ Project. The file names end with .c

这里的问题是关键字搞砸(显示布尔所强调的在编辑器/有效,但编译器不喜欢它)。

The problem with this is the keywords are messed up (shows bool as highlighted/valid in the editor, but compiler doesn't like it).

我去修/添加组件,他们有C#,F#,C ++,Visual Basic中;但没有C?

I went to repair/add components and they have C#, F#, C++, Visual Basic; but no C?

推荐答案

最新的C标准(C99)确实已经bool类型。只是包括 stdbool.h 键,你可以使用它。不幸的是MSVC根本不哈弗对C适当的支持。只有部分C89。

Newest C standard (C99) has bool type indeed. Just include stdbool.h and you can use it. Unfortunately MSVC does not haver proper support for C at all. Only partial C89.

这篇关于C没有一个布尔值?另外VS2010的问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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