473,507 Members | 2,377 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

I need some translations from C to C++

15 New Member
Just these:
printf();
scanf();
fread();
fwrite();
Nov 2 '09 #1
7 1631
newb16
687 Contributor
#include <stdio>
std::printf(...);
?
Nov 2 '09 #2
JonathanS
37 New Member
Should be #include <cstdio> I think.

He or she might be asking for cout/cin in place of printf/scanf? But like newb said if you really want to use the original c functions just use them directly in your C++ prog.
Nov 2 '09 #3
weaknessforcats
9,208 Recognized Expert Moderator Expert
#include <stdio>
std::printf(...);
?

Nope. What you show is C plus there is no <stdio> include. I believe you meant <cstdio>.

To the OP:

The functions you mention are replaced by operator<< and operator>> depending upon whether you are insrtingor extracting data from a stream.

The functions you mention can be used only with the built-on types of C whereas the operator<< and operator>> can be written by you to work woth any type of object.
Nov 2 '09 #4
nestle
15 New Member
@weaknessforcats
Well if you would be so kind as to tell me what those functions are exactly?
Like printf("Hello world");
How do I write it with the << >> operators?
Nov 2 '09 #5
RedSon
5,000 Recognized Expert Expert
Expand|Select|Wrap|Line Numbers
  1. cout << "Hello World";
Nov 2 '09 #6
nestle
15 New Member
@RedSon
Thanks.
Now how about the other 3 functions?
Nov 2 '09 #7
RedSon
5,000 Recognized Expert Expert
scanf would be
Expand|Select|Wrap|Line Numbers
  1. cin >> var;
And for the rest it is the same just use a file stream instead of cout and cin. Or even better, you could use google to help you look up usage!
Nov 2 '09 #8

Sign in to post your reply or Sign up for a free account.

Similar topics

2
1411
by: Francesc Guim Bernat | last post by:
Dear Collegues, I've developed an application with .NET framework using System.Xml utilities. But now I can verify that my applications works more slower than i expected. I think that it's...
6
5101
by: sdowney717 | last post by:
Code page translations are not supported for the text data type. From: 1252 To: 950. I would like to know what this message means. I also installed the language packs in advanced settings,...
9
10604
by: Robert Schneider | last post by:
Hi to all, I don't understand that: I try to delete a record via JDBC. But I always get the error SQL7008 with the error code 3. It seems that this has something to do with journaling, since the...
4
3337
by: Guy | last post by:
I got a big Access file (1 400 tables) to convert to SQL and I would like to be provided with some automated tools, except upsizing wizard and DTS, to convert it on my own. I got a lot of forms...
4
1991
by: Sa¹o Zagoranski | last post by:
Hi, I'm trying to play an AVI file from memory with MCI. The documentation is great if you want to play a file from a file but directly from memory... almost nothing. After hours of...
4
1511
by: AViS | last post by:
Hi, I am building a language translator, that must convert input from source languages to a language neutral format in XML. This XML must be read by the target language translator and produce the...
22
2301
by: the_grove_man | last post by:
I purchased a book titled "Pro ASP.NET 2.0" to get up to speed on web stuff because I ususally do Windows Form Applications.. But in the first chapters I was reading this week it brought to mind...
6
1354
by: Schraalhans Keukenmeester | last post by:
Geld hoeft het niet meer te kosten klaarblijkelijk (eindelijk). Gratis certificates op http://www.cacert.org/
1
1615
by: bwnyer | last post by:
Hello, I am trying to add translations to an c++/qt3 application. I am using QTranslator and after some time everything seems to work so far. But the application also contains some plugins and I...
24
1373
by: kevin | last post by:
write a program in c.
0
7223
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7319
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
7376
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
5623
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
5042
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
4702
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3191
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
1
760
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
412
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.