-4

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.

balu
  • 167
  • 1
  • 4

2 Answers2

5

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.

Community
  • 1
  • 1
NPE
  • 486,780
  • 108
  • 951
  • 1,012
1

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.

Nigel Harper
  • 1,270
  • 9
  • 13
  • +1 The only correct answer so far: `printf` also is not a keyword and you really shouldn't use it for your own identifiers. – pmg Jul 28 '11 at 14:55