8

I have included stdio.h into my C++ project, why am I still getting this error? Also, after I added #include , printf(), in my code, was no longer underlined in red to suggest that there was any error.

Also, I would like to use the function, format(). Which library is that found in?

Raisintoe
  • 201
  • 1
  • 4
  • 11
  • 1
    "Which library is that found in?" - Boost? TinyFormat? cppformat? You tell us. – chris Apr 27 '15 at 03:51
  • 1
    *"I have included stdio.h into my C++ project, why am I still getting this error?"* - please provide your compile command, your link command, and the exact error you are receiving. Do so by adding it to your question by clicking *Edit* (and don't post it as a comment). Otherwise, there's not enough information to help troubleshoot it. – jww Apr 27 '15 at 03:54
  • 1
    *"I would like to use the function, format()..."* - that's *not* a standard C library function. What did you have in mind? Are you using an external library? Do you have a reference to the function? – jww Apr 27 '15 at 03:55
  • As with spelling in word processors, IDE underlining is just a hint that there *could be* something wrong. Underlining doesn't definitely mean wrong, no underlining doesn't definitely mean correct. – molbdnilo Apr 27 '15 at 04:54

2 Answers2

12

you must include stdio.h instead of cstdio.h

#include <stdio.h>

Mohsen Bahaloo
  • 257
  • 2
  • 2
2

Use
#include< cstdio>
using namespace std;
after that you can use printf()

LoveToCode
  • 296
  • 2
  • 18
  • You should not motivate other people to do bad practices. [Why is “using namespace std;” considered bad practice?](https://stackoverflow.com/questions/1452721/why-is-using-namespace-std-considered-bad-practice) – Gary Strivin' Dec 16 '20 at 19:51