Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

'printf': identifier not found

Tags:

c++

printf

stdio

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?

like image 605
Raisintoe Avatar asked Apr 27 '15 03:04

Raisintoe


2 Answers

you must include stdio.h instead of cstdio.h

#include <stdio.h>

like image 123
Mohsen Bahaloo Avatar answered Sep 21 '22 10:09

Mohsen Bahaloo


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

like image 43
LoveToCode Avatar answered Sep 19 '22 10:09

LoveToCode