how c language to realize multiple ?

M

Mark A. Odell

liu said:
how c language to realize multiple ? can anyone tell me , thank you!

That's easy, just define it, e.g.

int main(void)
{
int multiple; /* <-- multiple now realized */

return 0;
}

Glad to help.
 
M

Morris Dovey

liu said:
how c language to realize multiple ? can anyone tell me , thank you!

Liu...

English language problem:

multiple == more than one

Did you mean multiply (mathematical operation) ?
 
J

Jarno A Wuolijoki

how c language to realize multiple ? can anyone tell me , thank you!

Bizarrely. Avoid them.
(or look up trigraphs if you really need the gory details)
 
J

James Hu

Bizarrely. Avoid them.
(or look up trigraphs if you really need the gory details)

Aha! You have an excellent natural language parser in your noggin.

Does the OP mean in a string literal or character constant? The answer
is to use the \? escape sequence.

-- James
 
P

Peter Nilsson

Arthur J. O'Dwyer said:
how c language to realize multiple ? can anyone tell me , thank you!

char queries[] = "????????????????";

Quick -- what is the output of

puts(queries);
????????????????

No peeking! :)

A more interesting scenario is...

char queries[] = "'????????????????'";

Mac programmers of old should know, or at least know there's a potential
problem.
 
C

CBFalconer

Arthur J. O'Dwyer said:
liu said:
how c language to realize multiple ? can anyone tell me

char queries[] = "????????????????";

Quick -- what is the output of

puts(queries);

No peeking! :)

It is "????????????????" without the quotes and with a final
'\n'. Assuming a system that conforms to the C standard.
 
A

Arthur J. O'Dwyer

Arthur J. O'Dwyer said:
char queries[] = "????????????????";

Quick -- what is the output of

puts(queries);

????????????????

Whoops -- my memory was faulty! I could've sworn there
was an "escape" trigraph ??? => ?, so that the above would
print fewer ?s than expected. But there's not. Peter and
Chuck are correct.
A more interesting scenario is...

char queries[] = "'????????????????'";

Mac programmers of old should know, or at least know there's a potential
problem.

<ot>
Did some Mac language contain the ??' => ^ trigraph?
</ot>

-Arthur
 
S

Sheldon Simms

Arthur J. O'Dwyer said:
On Fri, 21 Nov 2003, CBFalconer wrote:

char queries[] = "????????????????";

Quick -- what is the output of

puts(queries);

????????????????

Whoops -- my memory was faulty! I could've sworn there
was an "escape" trigraph ??? => ?, so that the above would
print fewer ?s than expected. But there's not. Peter and
Chuck are correct.
A more interesting scenario is...

char queries[] = "'????????????????'";

Mac programmers of old should know, or at least know there's a potential
problem.

<ot>
Did some Mac language contain the ??' => ^ trigraph?
</ot>

Old Mac C compilers let you pack 4 8-bit characters in an int by including
them all in a character literal:

int creator = 'PROG';
int type = 'myTp';

This was necessary because such multi-character constants were used by the
operating system to as program and file-type identifiers. I don't know if
that's exactly what Arthur is talking about though, because I don't
remember there being an issue with including such character constants in
string literals. I guess it's been too long.
 
P

Peter Nilsson

Arthur J. O'Dwyer said:
A more interesting scenario is...

char queries[] = "'????????????????'";

Mac programmers of old should know, or at least know there's a potential
problem.

<ot>
Did some Mac language contain the ??' => ^ trigraph?
</ot>

It was avoided by writing '???\?' instead of '????' (a common constant).
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
474,266
Messages
2,571,083
Members
48,773
Latest member
Kaybee

Latest Threads

Top