开发者

can any one tell me stream is a reserved keyword in c or c++; [closed]

开发者 https://www.devze.com 2023-03-23 18:01 出处:网络
It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical andcannot be reasonably answered in its current form. For help clari
It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center.开发者_JAVA技巧 Closed 10 years ago.

I am using a function pointer variable named as "stream. SO i think it might create errors if it is a reserved keyword in c or c++. Thanks in advance.


No, stream is not a keyword in either C or C++. See the accepted answer to Why is "array" marked as a reserved word in Visual-C++?

However, as pointed out by @pmg, this is not the whole story. Identifiers starting with str followed by a lowercase letter are reserved by the C standard for additional string functions. The gcc manual provides a handy list of identifiers to be avoided.


As other answers say stream is not a keyword.

However it IS technically a reserved identifier - all identifiers starting with str followed by a lower case letter are reserved for future additions to string.h

So in theory there's a possibility that a future version of C could introduce a standard function called stream and thus break your code. However the actual chance of that happening is probably tiny.

0

精彩评论

暂无评论...
验证码 换一张
取 消