fprintf just is not working. I am using PHP Version 4.3.9. Whatever I
do fprintf just fails.
For example:
fwrite($Handle, 'A1');
fprintf($Handle, 'A2);
The first line always works, the second always fails. Likewise any
other example.
Suggestions? 4 2699
On 13 Feb, 22:13, grim...@blackbelts.co.uk wrote:
fprintf($Handle, 'A2);
Should be fprintf($Handle, 'A2');
That's just a typo not the problem! gr*****@blackbelts.co.uk wrote:
fprintf just is not working. I am using PHP Version 4.3.9. Whatever I
do fprintf just fails.
For example:
fwrite($Handle, 'A1');
fprintf($Handle, 'A2);
The first line always works, the second always fails. Likewise any
other example.
Suggestions?
'A2' isn't a format string?
Paul Lautman wrote:
gr*****@blackbelts.co.uk wrote:
>fprintf just is not working. I am using PHP Version 4.3.9. Whatever I do fprintf just fails.
For example:
fwrite($Handle, 'A1'); fprintf($Handle, 'A2);
The first line always works, the second always fails. Likewise any other example.
Suggestions?
'A2' isn't a format string?
No, that's not the issue, but unless he needs to use printed
formatting, there's no real reason to use fprintf over fwrite.
@Original Poster: how does fprintf fail, do you get an error, or is
the input not written how you expected? You need to give details, or
no one can help you.
In the meantime, try reading the manual: <http://php.net/fprintf>
On 14 Feb, 03:29, Curtis <zer0d...@verizon.netwrote:
Paul Lautman wrote:
grim...@blackbelts.co.uk wrote:
fprintf just is not working. I am using PHP Version 4.3.9. Whatever I
do fprintf just fails.
For example:
fwrite($Handle, 'A1');
fprintf($Handle, 'A2);
The first line always works, the second always fails. Likewise any
other example.
Suggestions?
'A2' isn't a format string?
No, that's not the issue, but unless he needs to use printed
formatting, there's no real reason to use fprintf over fwrite.
@Original Poster: how does fprintf fail, do you get an error, or is
the input not written how you expected? You need to give details, or
no one can help you.
In the meantime, try reading the manual: <http://php.net/fprintf>- Hide quoted text -
- Show quoted text -
It gives an run time error because none of the statements below it are
executed.
I got round it by using sprintf (exactly the same apart from the
different first argument) into a string, and then fwrite.
Rob This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics
by: Arti Potnis |
last post by:
Hi,
I have an application with a function "myfunction" that opens a file
and writes to it using fprintf.
This application runs on a unix (sun solaris 5.8) system.
I connect to this application...
|
by: hpy_awad |
last post by:
formatting float variables to fprintf has error to my writing to
output file called rental and I do not the reason that a rabish is
written to the file instead of the actual input screen values ?
...
|
by: hpy_awad |
last post by:
I am writing stings ((*cust).name),((*cust).address)to a file using
fgets but rabish is being wrote to that file ? Look to my source
please and help me finding the reason why this rabish is being...
|
by: Smegly |
last post by:
Hi,
I'm confused about a situation i have ..
fprintf works in one function, but not in the other . .
This is my part of my code for the two functions ..
void customer(FILE *fin, FILE...
|
by: G Patel |
last post by:
E. Robert Tisdale wrote:
>
> int main(int argc, char* argv) {
> quad_t m = {0, 1, 2, 3};
> int r;
> fprintf(stdout, "m = (");
> for (size_t...
|
by: jchludzinski |
last post by:
I tryin' to print out a string with a variable number of blanks/spaces
preceding the string. I know that if I use:
fprintf( stdout, "%12s", string );
I get 12 blanks preceding 'string'. If I...
|
by: samac |
last post by:
Hi all,
Need some help in c. I have not been in programming for ten years. Here is my problem:
From main(), I call a function - a_function(). In a_function(), I call another function...
|
by: Prayag Narula |
last post by:
Hi,
I want to redefine fprintf for debugging purposes. That is I want that
all the output that is going to the stdout should be logged in a
file.
I tried something like
#define fprintf...
|
by: David Mathog |
last post by:
In the beginning (Kernighan & Ritchie 1978) there was fprintf, and unix
write, but no fwrite. That is, no portable C method for writing binary
data, only system calls which were OS specific. At...
|
by: emmanuelkatto |
last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud.
Please let me know.
Thanks!
Emmanuel
|
by: BarryA |
last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
|
by: nemocccc |
last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
|
by: Hystou |
last post by:
There are some requirements for setting up RAID:
1. The motherboard and BIOS support RAID configuration.
2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
|
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,...
|
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
|
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...
|
by: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
|
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...
| |