c without usin any graphics function

C

Chris Hills

Walter Roberson said:
What evidence do you have to support those conclusions?

All *I* see is that his posting headers indicate that he *posted*
from MSIE on Windows NT. The platform he posted from is a very
different question from the platform he has to write the program for.

The OP's question read to me much like homework, or perhaps
an interview question:

That was my first thought actually.
 
R

Richard Heathfield

kuyper said:
Richard Heathfield wrote:
...

All of them? Every single one?

Only the ones that matter. In this case, Chris Hills commented on my use
of the word "implementation" by substituting the word "platform".
Presumably he had a purpose in so doing, but I still don't know what
that purpose was, and he has not seen fit to enlighten me.
That could be a large subset of the
English language. I haven't noticed you routinely defining every term
you use that isn't in the standard.

True enough - but if someone doesn't understand a term I use, they have
only to ask. I have asked what Chris Hills means by "platform", and he
hasn't (yet) answered.
In the standard itself, and in discussion of the standard, you should
normally understand every term that isn't defined by the standard
itself as having it's conventional in-context ordinary English
meaning, I see no reason not to apply that rule to "platform" in this
context.

I have consulted my trusty Chambers dictionary, which has an
approximately 200-word entry for "platform", with at least a couple of
dozen definitions, none of which can reasonably be interpreted as
having anything to do with the subject under discussion (except,
perhaps, the definition "a medium for discussion"(!), which doesn't get
us very far).
 
F

Flash Gordon

Chris Hills wrote, On 07/09/07 11:41:
A more useful comment is that this only works on and MS platform?

It would certainly be more inaccurate.
[markg@cpa-re-test ~]1001$ locate conio.h
/usr/lib/bcc/include/conio.h
[markg@cpa-re-test ~]1002$ uname -a
Linux cpa-re-test 2.4.21-27.0.2.EL.sgi9smp #1 SMP Wed Feb 23 07:14:32
PST 2005 i686 i686 i386 GNU/Linux
[markg@cpa-re-test ~]1004$ rpm -qf /usr/lib/bcc/include/conio.h
dev86-0.16.3-8
[markg@cpa-re-test ~]1005$
Not always but if we are assuming "conio.h" then it should

Wrong again.
[markg@cpa-re-test ~]1007$ cat t.c
void main()
{
}
[markg@cpa-re-test ~]1008$ gcc t.c
t.c: In function `main':
t.c:2: warning: return type of `main' is not `int'
[markg@cpa-re-test ~]1009$
He is apparently using an MS platform. If you can't tell that perhaps
you should not be giving any advice.

Ah, but the OP may well not be, so Keith is correct to report the problems.

So there is a good chance of it NOT working on the OPs platform and the
OP needs to know the advice given by this respondent is not generally
applicable.
Et too... No need to keep up the "this is not standard C" mantra Either
be helpful or don't get involved.

Your reply was not helpful, so perhaps you should follow your own advice.
 
K

kuyper

Richard Heathfield wrote:
....
I have consulted my trusty Chambers dictionary, which has an
approximately 200-word entry for "platform", with at least a couple of
dozen definitions, none of which can reasonably be interpreted as
having anything to do with the subject under discussion (except,
perhaps, the definition "a medium for discussion"(!), which doesn't get
us very far).

I won't attempt a rigorous definition of the term, but I've frequently
seen "platform" used to refer to the system hardware and software
supporting a given implementation of C. Surely at least one of those
dictionary entries is consistent with that usage? If not, it needs to
be updated. I went to www.ask.com and typed "what is a computer
platform" (it is clear that we were talking about "platform" in the
context of computers, right?), and recieved links to dozens of sites,
most of which confirmed that meaning.
That meaning fits very nicely the context in which Chris used the
term. I'm surprised that you're unfamiliar with this usage, and I'm
surprised that you gave any significant amount of thought to
considering the possibility that any other possible meaning applied.
 
R

Richard Heathfield

kuyper said:
Richard Heathfield wrote:
...

I won't attempt a rigorous definition of the term, but I've frequently
seen "platform" used to refer to the system hardware and software
supporting a given implementation of C.

I've seen it used in that way, yes. But I've seen it used to refer
solely to the hardware. I've seen it used to refer solely to the
operating system. And I've seen it used to refer to the implementation
itself.
Surely at least one of those
dictionary entries is consistent with that usage?

Nope. I won't bother quoting the entry. It would take far too long to
type, and would be terribly tedious to read.
If not, it needs to be updated.

You can take that up with Chambers if you like. :)

That meaning fits very nicely the context in which Chris used the
term. I'm surprised that you're unfamiliar with this usage,

But I'm not! I'm familiar with that usage and with others (see above),
any one of which could have been meant. I am still not sure which
meaning Chris Hills had in mind, and I'm still not sure why he bothered
to perform the substitution in the first place.

<snip>
 
K

kuyper

Richard said:
kuyper said: ....

I've seen it used in that way, yes. But I've seen it used to refer
solely to the hardware. I've seen it used to refer solely to the
operating system. And I've seen it used to refer to the implementation
itself. ....

But I'm not! I'm familiar with that usage and with others (see above),
any one of which could have been meant. I am still not sure which
meaning Chris Hills had in mind, and I'm still not sure why he bothered
to perform the substitution in the first place.

Well, obviously he can't be referring to the hardware-only definition,
not if he's qualifying it with MS.

If he's using the OS-only definition, then he's clearly refering to
every system that has MS as the OS. If he's using the OS&hardware
definition, he's clearly referring to every system where the OS is MS,
and the hardware is unspecified. If he's referring to the
implementation itself, he's referring to implementations that work
under MS. As far as I can see, the set of systems he's referring to is
precisely the same, regardless of which of those three definitions of
"platform" that he's referring to. So why do you care which one he's
using?
 
C

Chris Hills

Richard Heathfield said:
kuyper said:


Only the ones that matter. In this case, Chris Hills commented on my use
of the word "implementation" by substituting the word "platform".
Presumably he had a purpose in so doing, but I still don't know what
that purpose was, and he has not seen fit to enlighten me.

That it was a Windows or DOS system. Not sure whose [compiler]
implementation might have been Borland, MS or another
 
F

Flash Gordon

kuyper wrote, On 08/09/07 16:04:
Well, obviously he can't be referring to the hardware-only definition,
not if he's qualifying it with MS.

Never heard of the Xbox? MS do a certain amount of HW. So how about an
Xbox hacked to run Linux?
If he's using the OS-only definition, then he's clearly refering to
every system that has MS as the OS.
Yes.

If he's using the OS&hardware
definition, he's clearly referring to every system where the OS is MS,
and the hardware is unspecified.

Or every implementation where the OS is MS and the hardware is MS, e.g.
and Xbox that has not been hacked to run Linux.
If he's referring to the
implementation itself, he's referring to implementations that work
under MS. As far as I can see, the set of systems he's referring to is
precisely the same, regardless of which of those three definitions of
"platform" that he's referring to. So why do you care which one he's
using?

Not all implementations on MS OSs use the MS libraries, and there are
certainly compilers not written by MS.

So which one is being referred to does make a difference.

Oh, and perhaps one day Wine will work well enough to run MSVC in which
case you could use an MS compiler on a non-MS OS.
 
A

Army1987

Yes to both, in both the source and execution character set.
In the official printed C89 document, section 2.2.1,
the bar shown is the solid bar, not the broken bar. The bar
is also trigraphed as ??!

But it doesn't require that they must *look* that way.

C99 rationale:

5.2.1 Character sets
The C89 Committee ultimately came to remarkable unanimity on the subject of character set
20 requirements. There was strong sentiment that C should not be tied to ASCII, despite its heritage
and despite the precedent of Ada being defined in terms of ASCII. Rather, an implementation is
required to provide a unique character code for each of the printable graphics used by C, and for
each of the control codes representable by an escape sequence. (No particular graphic
representation for any character is prescribed; thus the common Japanese practice of using the
25 glyph “¥†for the C character “\†is perfectly legitimate.) Translation and execution
environments may have different character sets, but each must meet this requirement in its own
way. The goal is to ensure that a conforming implementation can translate a C translator written
in C.

5.2.1.1 Trigraph sequences
[snip]
The characters in the ASCII repertoire used by C and absent from
the ISO/IEC 646 invariant
repertoire are:
#[]{}\|~^
Given this repertoire, the C89 Committee faced the problem of defining
representations for the
5 absent characters. The obvious idea of defining two-character escape
sequences fails because C
uses all the characters which are in the ISO/IEC 646 repertoire, so no
single escape character is available. The best that can be done is to
use a trigraph: an escape digraph followed by a distinguishing
character.
MSE.4 Support for invariant ISO/IEC 646
[snip]
ISO/IEC 646, the international standard corresponding to ASCII,
permits national variants of a
number of the characters used by C. Strictly speaking, this is not a
problem in representing C programs, since the necessary characters
exist in all such variants: they just print oddly.
10 Displaying C programs for human edification suffers, however, since the
operators and
punctuators can be hard to recognize in their various altered forms.
C90 addresses the problem in a different way. It provides replacements
at the level of individual characters using three-character sequences
called trigraphs (see §5.2.1.1). For example, ??< is entirely
equivalent to {, even within a character constant or string literal.
While this approach
15 provides a solution for the known limitations of EBCDIC (except for the
exclamation mark) and
ISO/IEC 646, the result is arguably not highly readable.
 
R

Richard Heathfield

kuyper said:

Well, obviously he can't be referring to the hardware-only definition,
not if he's qualifying it with MS.

The world is larger than you realise.
 
R

Richard Bos

Philip Potter said:
Even on a freestanding implementation main may be required to return int.

Are hosted implementations free to accept void main(void) if they wish?

A hosted implementation is free to accept struct tm main(ptrdiff_t
bloogle), if it wishes to. That does not mean that one should use struct
tm main(ptrdiff_t bloogle), or even void main(), in C code posted to
this newsgroup, or anywhere else where one doesn't want to be tied to a
single implementation.

Richard
 

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

No members online now.

Forum statistics

Threads
474,432
Messages
2,571,680
Members
48,796
Latest member
Greg L.

Latest Threads

Top