printf problem with Visual c++ v6

Hi,
   I've just installed Visual c++ v6.0 and now for some reason the my prog keeps falling over when it gets to a printf statement. It comes up with a locate file dialogue box saying "Please enter the path for Printf.c" Any ideas?

Cheers,

           Dust.
dustybrynAsked:
Who is Participating?

[Webinar] Streamline your web hosting managementRegister Today

x
 
aarti_yConnect With a Mentor Commented:

Did you tried stepping over the code. does it work when u dont run it in debug mode?
if yes then u do have all the src files. but if not then search for printf.c on your PC. the path for that should be.

C:\Program Files\Microsoft Visual Studio\VC98\CRT\SRC

something like that, depending on your installation.

see that you have that path listed in includes (in IDE)



0
 
aarti_yCommented:
Open a  New Text file

put in following code.


#include <iostream.h>


int main()
{

printf("Hello WOrld");




return 0;

}

save it as text.c
build the project , and run it..

even then if it gives u the same error, then reply back

thanks
0
 
stefan73Commented:
Hi aarti_y,
> #include <iostream.h>
#include <stdio.h>

...instead.

Cheers!

Stefan
0
Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 
jkrCommented:
>> It comes up with a locate file dialogue box saying "Please enter the path for Printf.c"

This is a debugger message indicating that something went awry. Could you post your code?
0
 
aravindtjCommented:
hi,
 you r using C++. So think in C++.
all so check your compiler options.
  simple implementation is...

#include <iostream>

using namespace std;

int main()
{
 cout<<"Experts-Exchange."<<"\n";
return 0;
}

If you want to include implicit c code, use extern "C" {....} statement.

All the best.

0
 
pankajtiwaryCommented:
In C++ I suppose you need to include <cstdio> all C standard library are kept there I suppose.
0
 
dustybrynAuthor Commented:
I appreciate your comments but I know there is no problem with my code as it ran fine using Visual C++ v5 (albeit on a different machine). It also runs fine on a UNIX platform. When I first discovered the problem I tried the following as a test and got the same results.

#include <stdio.h>

void main()
{
      printf("hello");
}


0
 
jkrCommented:
Are you trying to step into that code using a debugger or just running that program on the command line?
0
 
cool_alokCommented:
friendz,
        when you program fail on call of printf ,so compiler/debugger search for code of printf to show you wher is problem,as or may be you haven't installed visual studio with full src that why it's causing the problem.

0
 
dustybrynAuthor Commented:
Hi, I'm trying to step into my code. The compiler does step into the code of printf although I am not experienced enough to make sense of this.

Thanks,

Dust.

0
All Courses

From novice to tech pro — start learning today.