473,394 Members | 1,724 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

int format, pointer arg ?

Hello - I have this simple code that gives me the warning: "int format, pointer arg (arg 3)"

Expand|Select|Wrap|Line Numbers
  1. BOOL read, write;
  2. FILE *t;
  3. more code...
  4.  
  5. fprintf( t, "Operation is %c\n", (read)?"READ":(write)?"WRITE":"none" );
  6.  
I don't see how arg 3 is a pointer? They are boolean...Please advise...
thanks!
Jul 25 '08 #1
3 4455
Laharl
849 Expert 512MB
String literals are stored as const char[], which, when passed to a function, is treated as a const char*. Read the Arrays Revealed Howto for more information.
Jul 25 '08 #2
String literals are stored as const char[], which, when passed to a function, is treated as a const char*. Read the Arrays Revealed Howto for more information.
The article says nothing about const or string literals...although it was interesting otherwise. If the string liter is stored as a char[], should it be printed using %s? thanks!
Jul 25 '08 #3
oler1s
671 Expert 512MB
You need to be using %s because you have a string, yes.
Jul 25 '08 #4

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

Similar topics

6
by: J | last post by:
Would anyone know if there a type tag to format a double? I have f for floating point, but cannot find one for double.
16
by: David | last post by:
I have following code. float b; b= 1.234; cout<<hex<<b<<endl; How come it cannot ouput the hex representation of b?
5
by: nimdez | last post by:
Hi, I am working on an existing code base in which a lot of data displayed to the user is formatted in tables. Most tables are printed row-by-row using printf() with "%s" print conversion...
48
by: Daniel Rudy | last post by:
Hello, On a x86 machine, what is the format of a pointer in C? I know for a fact that the x86 p-mode uses a /selector:offset/ notation where the selector is defined in either the GDT or LDT. ...
7
by: ranjeet.gupta | last post by:
Dear All As I was going through the code, I find the below piece of code, #define FILEMAPPING \ char *data; \ int size; \ char *position; \ int (*open)(struct FileMapping *self, const...
1
by: Derek =?utf-8?Q?Kuli=C5=84ski?= / takeda | last post by:
I spent many hours on this, googling around and experimenting, and still nothing. I wrote an umanaged program (actually various classes), while I was developing them I used command line to test...
3
by: Derek =?utf-8?Q?Kuli=C5=84ski?= / takeda | last post by:
I spent many hours on this, googling around and experimenting, and still nothing. I wrote an umanaged program (actually various classes), while I was developing them I used command line to test...
12
by: param | last post by:
Hi All, I want to use %x as directive to get the locale specific date representation. But, at the same time, i want to know the format of the output for interpreting it through program. Is there...
7
by: jayapal | last post by:
Hi all, what is %p format specifier indicates in the printf statement? regards, Jay
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
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
0
BarryA
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...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
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...
0
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
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
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

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.