Solved

printf problem with Visual c++ v6

Posted on 2004-10-12
13
707 Views
Last Modified: 2013-12-14
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.
0
Comment
Question by:dustybryn
  • 2
  • 2
  • 2
  • +4
13 Comments
 

Expert Comment

by:aarti_y
ID: 12288723
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
 
LVL 12

Expert Comment

by:stefan73
ID: 12289195
Hi aarti_y,
> #include <iostream.h>
#include <stdio.h>

...instead.

Cheers!

Stefan
0
 
LVL 86

Expert Comment

by:jkr
ID: 12289309
>> 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
 
LVL 3

Expert Comment

by:aravindtj
ID: 12289358
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
 
LVL 4

Expert Comment

by:pankajtiwary
ID: 12292757
In C++ I suppose you need to include <cstdio> all C standard library are kept there I suppose.
0
Why You Should Analyze Threat Actor TTPs

After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

 

Author Comment

by:dustybryn
ID: 12295535
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
 
LVL 86

Expert Comment

by:jkr
ID: 12298402
Are you trying to step into that code using a debugger or just running that program on the command line?
0
 
LVL 1

Expert Comment

by:cool_alok
ID: 12305409
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
 

Author Comment

by:dustybryn
ID: 12305686
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
 

Accepted Solution

by:
aarti_y earned 125 total points
ID: 12309619

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

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Suggested Solutions

Preface I don't like visual development tools that are supposed to write a program for me. Even if it is Xcode and I can use Interface Builder. Yes, it is a perfect tool and has helped me a lot, mainly, in the beginning, when my programs were small…
Windows programmers of the C/C++ variety, how many of you realise that since Window 9x Microsoft has been lying to you about what constitutes Unicode (http://en.wikipedia.org/wiki/Unicode)? They will have you believe that Unicode requires you to use…
Video by: Grant
The goal of this video is to provide viewers with basic examples to understand and use for-loops in the C programming language.
The viewer will learn how to use and create keystrokes in Netbeans IDE 8.0 for Windows.

707 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now