how I can introduce printf and scanf in microsoft visual c++ 2010 express
i used #include<stdio.h> , #include<isotream> and using namespace std;

put it still doesnt work ???

Recommended Answers

All 3 Replies

This being C++, we prefer cstdio.

#include <cstdio>

int main()
{
  char c;
  std::scanf("%c", &c);
  std::printf("You typed %c", c);
}

As I recall, the C++ standard promises the functions will be in the std namespace, and they may also be in the global namespace.

thank you so much

Or,

    #include <stdio.h>
    int main()
    {
        char c;
        ::scanf("%c", &c);
        ::printf("You typed %c", c);
    }
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.