473,471 Members | 1,964 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Without semicolons

Write a program that takes a C program in source form as input and
prints the source code for a program with equivalent behaviour, but
without semicolons, on standard output.

Please note that I'm not interested in the DMS Software Reengineering
Toolkit.

Jeremy.
Nov 14 '05 #1
27 1957
int main(int x, char *t[]){if(puts(t[1])){}}

compile to file 'a' and run this in your command line

a "the source goes here"
Nov 14 '05 #2
Jeremy Yallop <je****@jdyallop.freeserve.co.uk> writes:
Write a program that takes a C program in source form as input and
prints the source code for a program with equivalent behaviour, but
without semicolons, on standard output. Please note that I'm not interested in the DMS Software Reengineering
Toolkit.

Yes sir, I'll get on to writing this program straight away.
I'm not interested in the DMS Software Reengineering Toolkit, either.

Chris.
Nov 14 '05 #3
Chris McDonald wrote:
Jeremy Yallop <je****@jdyallop.freeserve.co.uk> writes:
Write a program that takes a C program in source form as input and
prints the source code for a program with equivalent behaviour, but
without semicolons, on standard output.

Please note that I'm not interested in the DMS Software Reengineering
Toolkit.


Yes sir, I'll get on to writing this program straight away.
I'm not interested in the DMS Software Reengineering Toolkit, either.


If you were to search the archives (or lurk for a while) in order to
establish some context, you might be less inclined to post such rude
(and absurd) responses.

Jeremy.
Nov 14 '05 #4
Martin Johansen wrote:
int main(int x, char *t[]){if(puts(t[1])){}}

compile to file 'a' and run this in your command line

a "the source goes here"


I have no idea why you think this is a solution.

Jeremy.
Nov 14 '05 #5
Jeremy Yallop wrote:
Write a program that takes a C program in source form as input and
prints the source code for a program with equivalent behaviour, but
without semicolons, on standard output.


There is one really serious problem with that, other than string
literals and character constants (and being a stupid idea in the
first place): declarations are terminated with a semi-colon.

--
++acr@,ka"
Nov 14 '05 #6
Sam Dennis wrote:
Jeremy Yallop wrote:
Write a program that takes a C program in source form as input and
prints the source code for a program with equivalent behaviour, but
without semicolons, on standard output.


There is one really serious problem with that, other than string
literals and character constants (and being a stupid idea in the
first place): declarations are terminated with a semi-colon.


String literals and character constants are not a problem if you don't
mind restricting yourself to a particular character set. Declarations
are admittedly rather difficult to handle, but by no means impossible.
Here are a couple of clues:

int foo()
{
int x = 3;
float y = 2.0;
...
return something;
}

can be transformed to

void foo_helper(int x, float y, int *rv)
{
...
if (*rv = something) { }
}

void foo(int *rv)
{
if (foo_helper(3, 2.0, rv)) { }
}

It might appear that a (non-definition) declaration is required for at
least one of two mutually recursive functions, but that's not the
case:

void one()
{
if (((void (*)())two)(), 0) { }
}

void two()
{
if (one(), 0) { }
}

I'm pretty sure that it can be done, although I welcome
counterexamples. I'm sorry that you thought the problem was stupid; I
thought it was considerably more interesting than the usual "without
using a semicolon" sort of questions that come up fairly frequently,
and (if solved) it has the additional advantage of making it
unnecessary to ever have to think of answers to those questions again.

I think that a program I'm working on now will be able to solve the
problem (and many others) when finished, by the way, but it's not
written in C and it won't be ready for a couple of months at least.

Jeremy.
Nov 14 '05 #7
Jeremy Yallop <je****@jdyallop.freeserve.co.uk> writes:
Chris McDonald wrote:
Jeremy Yallop <je****@jdyallop.freeserve.co.uk> writes:
Write a program that takes a C program in source form as input and
prints the source code for a program with equivalent behaviour, but
without semicolons, on standard output.
Please note that I'm not interested in the DMS Software Reengineering
Toolkit.


Yes sir, I'll get on to writing this program straight away.
I'm not interested in the DMS Software Reengineering Toolkit, either.

If you were to search the archives (or lurk for a while) in order to
establish some context, you might be less inclined to post such rude
(and absurd) responses.

I read this newsgroup everyday.
What possible context is there?
Please explain how the directive to write such a program should be obeyed
by our readers.

The initial request is the absurb matter.
Nov 14 '05 #8
Chris McDonald wrote:
I read this newsgroup everyday.
What possible context is there?
Please explain how the directive to write such a program should be obeyed
by our readers.


Could we talk about C, instead, please?

Jeremy.
Nov 14 '05 #9
Chris McDonald wrote:
I read this newsgroup everyday.
What possible context is there?
Please explain how the directive to write such a program should be obeyed
by our readers.


Could we talk about C instead, please?

Jeremy.
Nov 14 '05 #10

On Mon, 10 May 2004, Jeremy Yallop wrote:

It might appear that a (non-definition) declaration is required for at
least one of two mutually recursive functions, but that's not the
case:

void one()
{
if (((void (*)())two)(), 0) { }
I don't think this does what you think it does. I *think* (pretty
strongly, but not entirely positive) that it implicitly declares
'two' as an 'int', and then tries to cast that 'int' to 'void(*)()'.
What you really meant to do was declare 'two' as a 'void(*)()', and
I think you might not be able to do that.
So, expert opinions needed on this, and also on this "solution":

void declare_voidCpDCD(void (*x)()) {}

void one()
{
if (declare_voidCpDCD(two), two(), 0) {}
}

Does the passing of 'two' to a function expecting a given type
implicitly declare 'two' with that type?

I'm pretty sure that it can be done, although I welcome
counterexamples. I'm sorry that you thought the problem was stupid; I
thought it was considerably more interesting than the usual "without
using a semicolon" sort of questions that come up fairly frequently,
and (if solved) it has the additional advantage of making it
unnecessary to ever have to think of answers to those questions again.
:-D
I think that a program I'm working on now will be able to solve the
problem (and many others) when finished,


This program isn't called the Analytical Engine, by any chance? ;)

-Arthur
Nov 14 '05 #11
Jeremy Yallop wrote:
Jeremy Yallop wrote:
Write a program that takes a C program in source form as input and
prints the source code for a program with equivalent behaviour, but
without semicolons, on standard output.


It might appear that a (non-definition) declaration is required for at
least one of two mutually recursive functions, but that's not the
case:


....in C89. Implicit function declarations were removed for C99.
(Besides, I'm pretty sure that even in C89 you couldn't cast any
undeclared identifier and then call it as a function; it appears
that it may be solvable in C89 by other means, though. Wrappers
are your friends here, if you really want to spend as many hours
of your life as this will indubitably take to accomplish without
any gaps on such a project.)

--
++acr@,ka"
Nov 14 '05 #12
Chris McDonald wrote:
Jeremy Yallop <je****@jdyallop.freeserve.co.uk> writes:
Chris McDonald wrote:
.... snip ...

Yes sir, I'll get on to writing this program straight away.
I'm not interested in the DMS Software Reengineering Toolkit,
either.

If you were to search the archives (or lurk for a while) in
order to establish some context, you might be less inclined to
post such rude (and absurd) responses.


I read this newsgroup everyday. What possible context is there?


There is a poster, who shall remain nameless, who pops up
periodically to flog the aforementioned Toolkit as the solution to
various problems. He never has any other comments or knowledge to
offer. That was a joke son, which you failed to recognize and
converted into a flame.

--
"I'm a war president. I make decisions here in the Oval Office
in foreign policy matters with war on my mind." - Bush.
"Churchill and Bush can both be considered wartime leaders, just
as Secretariat and Mr Ed were both horses." - James Rhodes.

Nov 14 '05 #13
Arthur J. O'Dwyer wrote:

On Mon, 10 May 2004, Jeremy Yallop wrote:

It might appear that a (non-definition) declaration is required for at
least one of two mutually recursive functions, but that's not the
case:

void one()
{
if (((void (*)())two)(), 0) { }
I don't think this does what you think it does. I *think* (pretty
strongly, but not entirely positive) that it implicitly declares
'two' as an 'int', and then tries to cast that 'int' to 'void(*)()'.


It's worse than that: it's just a plain error. "Implicit int" refers
to variable declarations without a type specifier, such as

static x;

As Sam Dennis points out, you can't use an undeclared identifier in
this context.
What you really meant to do was declare 'two' as a 'void(*)()', and
I think you might not be able to do that.
So, expert opinions needed on this, and also on this "solution":

void declare_voidCpDCD(void (*x)()) {}

void one()
{
if (declare_voidCpDCD(two), two(), 0) {}
}

Does the passing of 'two' to a function expecting a given type
implicitly declare 'two' with that type?


Unfortunately not: any undeclared identifier used as a function
designator is implicitly declared as returning int. I've realised
since I wrote the post you're replying to that implicit declaration
won't work at all here, since it can only be used for functions
returning int.
I think that a program I'm working on now will be able to solve the
problem (and many others) when finished,


This program isn't called the Analytical Engine, by any chance? ;)


Heh. That's not a bad name, actually. It's intended to be used for
general syntactic analysis (and transformations) of C source code;
basically a fancy parser with a bunch of hooks. I'm happy to say,
though, that its completion isn't dependent on the support of the
British government.

Jeremy.
Nov 14 '05 #14
Jeremy Yallop wrote:
Chris McDonald wrote:
Jeremy Yallop wrote:
Write a program that takes a C program in source form as input
and prints the source code for a program with equivalent
behaviour, but without semicolons, on standard output.

Please note that I'm not interested in the DMS Software
Reengineering Toolkit.


Yes sir, I'll get on to writing this program straight away. I'm
not interested in the DMS Software Reengineering Toolkit, either.


If you were to search the archives (or lurk for a while) in order
to establish some context, you might be less inclined to post such
rude (and absurd) responses.


"Yes sir, I'll get on to writing this program straight away." is
rude?!? You, my friend, seem to lack perspective.

Nov 14 '05 #15
Jeremy Yallop wrote:
Write a program that takes a C program in source form as input and
prints the source code for a program with equivalent behaviour, but
without semicolons, on standard output.

Please note that I'm not interested in the DMS Software Reengineering
Toolkit.

Jeremy.


The answer has been posted here many times.
Please search the newsgroups for "without" and "semicolon".

--
Thomas Matthews

C++ newsgroup welcome message:
http://www.slack.net/~shiva/welcome.txt
C++ Faq: http://www.parashift.com/c++-faq-lite
C Faq: http://www.eskimo.com/~scs/c-faq/top.html
alt.comp.lang.learn.c-c++ faq:
http://www.raos.demon.uk/acllc-c++/faq.html
Other sites:
http://www.josuttis.com -- C++ STL Library book
http://www.sgi.com/tech/stl -- Standard Template Library

Nov 14 '05 #16
Jeremy Yallop wrote:
Write a program that takes a C program in source form as input and
prints the source code for a program with equivalent behaviour, but
without semicolons, on standard output.


Replace all semicolons with NOT_A_SEMICOLON between some white space
and compile with the appropriate-something-like -DNOT_A_SIMICOLON=;
flag :-)

Or is this not funny?

Case

Nov 14 '05 #17
Thomas Matthews <Th*************************@sbcglobal.net> writes:
Jeremy Yallop wrote:
Write a program that takes a C program in source form as input and
prints the source code for a program with equivalent behaviour, but
without semicolons, on standard output. Please note that I'm not
interested in the DMS Software Reengineering Toolkit.


The answer has been posted here many times.


Huh? I seriously doubt that. :)

Martin
--
,--. Martin Dickopp, Dresden, Germany ,= ,-_-. =.
/ ,- ) http://www.zero-based.org/ ((_/)o o(\_))
\ `-' `-'(. .)`-'
`-. Debian, a variant of the GNU operating system. \_/
Nov 14 '05 #18
Case <no@no.no> writes:
Jeremy Yallop wrote:
Write a program that takes a C program in source form as input and
prints the source code for a program with equivalent behaviour, but
without semicolons, on standard output.


Replace all semicolons with NOT_A_SEMICOLON between some white space
and compile with the appropriate-something-like -DNOT_A_SIMICOLON=;
flag :-)


A compiler invoked with such a flag is *not* a conforming C
implementation.

Martin
--
,--. Martin Dickopp, Dresden, Germany ,= ,-_-. =.
/ ,- ) http://www.zero-based.org/ ((_/)o o(\_))
\ `-' `-'(. .)`-'
`-. Debian, a variant of the GNU operating system. \_/
Nov 14 '05 #19

On Tue, 11 May 2004, Jeremy Yallop wrote:

Arthur J. O'Dwyer wrote:
On Mon, 10 May 2004, Jeremy Yallop wrote:

if (((void (*)())two)(), 0) { }
I don't think this does what you think it does. I *think* (pretty
strongly, but not entirely positive) that it implicitly declares
'two' as an 'int', and then tries to cast that 'int' to 'void(*)()'.


It's worse than that: it's just a plain error.

[snip] As Sam Dennis points out, you can't use an undeclared identifier in
this context.


<slaps my forehead> Right. Well, anyway...
void declare_voidCpDCD(void (*x)()) {}

void one()
{
if (declare_voidCpDCD(two), two(), 0) {}
}

Does the passing of 'two' to a function expecting a given type
implicitly declare 'two' with that type?


Unfortunately not: any undeclared identifier used as a function
designator is implicitly declared as returning int.


<slaps your forehead> ;) No, I wasn't thinking again. This code
suffers from the same problem Sam Dennis showed with your code ---
'two' is undeclared in the first place it appears. That's a
syntax error. Still, we could write

if (0, two()) {}
if (((void(*)())two)(), 0) {}

and I believe the code would be strictly conforming. Or even:

if (sizeof two(), ((void(*)())two)(), 0) {}

Both of these implicitly declare 'two' as a function (of whatever
type), and then we cast the value of 'two' to the correct function
pointer type before we actually call it.

But the original problem, mutual recursion, is much easier
anyway:

void one(void (*two)()) {
if (two(one), 0) {}
}

void two(void (*one)()) {
if (one(two), 0) {}
}

int main(void) {
if (one(two), 0) {}
}

We were just trying to over-complicate things. :)
-Arthur
Nov 14 '05 #20
In <cu*************@zero-based.org> Martin Dickopp <ex****************@zero-based.org> writes:
Case <no@no.no> writes:
Jeremy Yallop wrote:
Write a program that takes a C program in source form as input and
prints the source code for a program with equivalent behaviour, but
without semicolons, on standard output.


Replace all semicolons with NOT_A_SEMICOLON between some white space
and compile with the appropriate-something-like -DNOT_A_SIMICOLON=;
flag :-)


A compiler invoked with such a flag is *not* a conforming C
implementation.


I can't see *any* requirement that the output is a C program, so Case's
solution is perfectly valid, with a couple of minor fixes:
-DNOT_A_SEMICOLON=";" (the Unix shell will treat an unprotected semicolon
as a command separator, which is not what you want).

However, the program specification is so flawed that an even simpler
solution is possible: reproduce the input with no changes at all. It
works for *a* C program that doesn't contain any semicolons in the first
place ;-)

Neither solution works if we replace "a C program" by "any C program",
and "for a program" by "for a C program", but then I seriously doubt
that *any* solution exists for this program specification, except for the
following cheat: -D__NOT_A_SEMICOLON=";". No correct C program can
use the __NOT_A_SEMICOLON identifier and a compiler invoked with this
option is still a conforming C compiler ;-) Any correct C program
will be converted to a C program invoking undefined behaviour,
but that will work as expected if compiled by a conforming compiler
invoked with the "magic" option.

Dan
--
Dan Pop
DESY Zeuthen, RZ group
Email: Da*****@ifh.de
Nov 14 '05 #21
Dan Pop wrote:
In <cu*************@zero-based.org> Martin Dickopp <ex****************@zero-based.org> writes:
Case <no@no.no> writes:
Jeremy Yallop wrote:
Write a program that takes a C program in source form as input and
prints the source code for a program with equivalent behaviour, but
without semicolons, on standard output.

Replace all semicolons with NOT_A_SEMICOLON between some white space
and compile with the appropriate-something-like -DNOT_A_SIMICOLON=;
flag :-)
A compiler invoked with such a flag is *not* a conforming C
implementation.


I can't see *any* requirement that the output is a C program, so Case's
solution is perfectly valid, with a couple of minor fixes:
-DNOT_A_SEMICOLON=";" (the Unix shell will treat an unprotected semicolon
as a command separator, which is not what you want).


No, this doesn't handle semicolons in strings.
However, the program specification is so flawed that an even simpler
solution is possible: reproduce the input with no changes at all. It
works for *a* C program that doesn't contain any semicolons in the first
place ;-)


Cute, but misguided. Admittedly "a" is in some respect ambiguous
between "any" and "a certain", but it can't be reasonably interpreted
as "a certain" in the text at the top of this post. When K&R write

Write a program that reads a C program and prints in alphabetical
order each group of variable names that are identical in the first
6 characters [...] (Exercise 6.2)

do you think that they are asking for a solution that only works on a
particular program of your choosing? There are plenty more such
examples. I think "so flawed" is pretty unreasonable: I don't think
you're in any doubt as to what the specification means.

Jeremy.
Nov 14 '05 #22
In <sl*******************@kaje.cl.cam.ac.uk> Jeremy Yallop <je****@jdyallop.freeserve.co.uk> writes:
Dan Pop wrote:
In <cu*************@zero-based.org> Martin Dickopp <ex****************@zero-based.org> writes:
Case <no@no.no> writes:
Jeremy Yallop wrote:
> Write a program that takes a C program in source form as input and
> prints the source code for a program with equivalent behaviour, but
> without semicolons, on standard output.

Replace all semicolons with NOT_A_SEMICOLON between some white space
and compile with the appropriate-something-like -DNOT_A_SIMICOLON=;
flag :-)

A compiler invoked with such a flag is *not* a conforming C
implementation.


I can't see *any* requirement that the output is a C program, so Case's
solution is perfectly valid, with a couple of minor fixes:
-DNOT_A_SEMICOLON=";" (the Unix shell will treat an unprotected semicolon
as a command separator, which is not what you want).


No, this doesn't handle semicolons in strings.


This is true, but unimportant: handling character and string literals is
a doable and relatively minor task.
However, the program specification is so flawed that an even simpler
solution is possible: reproduce the input with no changes at all. It
works for *a* C program that doesn't contain any semicolons in the first
place ;-)


Cute, but misguided. Admittedly "a" is in some respect ambiguous
between "any" and "a certain", but it can't be reasonably interpreted
as "a certain" in the text at the top of this post. When K&R write

Write a program that reads a C program and prints in alphabetical
order each group of variable names that are identical in the first
6 characters [...] (Exercise 6.2)

do you think that they are asking for a solution that only works on a
particular program of your choosing? There are plenty more such
examples. I think "so flawed" is pretty unreasonable: I don't think
you're in any doubt as to what the specification means.


My doubts are irrelevant. The fact is that your specification *can* be
interpreted as handling a single C program and generating a Fortran
program as output. And if I want to be really picky, I can point out that
according to the C standard, pretty much anything counts as a C program :-)
That's why I usually use the term "correct C program".

Dan
--
Dan Pop
DESY Zeuthen, RZ group
Email: Da*****@ifh.de
Nov 14 '05 #23
Martin Dickopp wrote:
Thomas Matthews <Th*************************@sbcglobal.net> writes:

Jeremy Yallop wrote:
Write a program that takes a C program in source form as input and
prints the source code for a program with equivalent behaviour, but
without semicolons, on standard output. Please note that I'm not
interested in the DMS Software Reengineering Toolkit.


The answer has been posted here many times.

Huh? I seriously doubt that. :)

Martin


Actually, many replies have been posted. Some suggestions,
some actual answers.

http://www.google.com/groups?as_q=wi...=&num=50&hl=en
--
Thomas Matthews

C++ newsgroup welcome message:
http://www.slack.net/~shiva/welcome.txt
C++ Faq: http://www.parashift.com/c++-faq-lite
C Faq: http://www.eskimo.com/~scs/c-faq/top.html
alt.comp.lang.learn.c-c++ faq:
http://www.raos.demon.uk/acllc-c++/faq.html
Other sites:
http://www.josuttis.com -- C++ STL Library book

Nov 14 '05 #24
Thomas Matthews <Th****************************@sbcglobal.net> writes:
Martin Dickopp wrote:
Thomas Matthews <Th*************************@sbcglobal.net> writes:
Jeremy Yallop wrote:

Write a program that takes a C program in source form as input and
prints the source code for a program with equivalent behaviour, but
without semicolons, on standard output. Please note that I'm not
interested in the DMS Software Reengineering Toolkit.

The answer has been posted here many times.

Huh? I seriously doubt that. :)


Actually, many replies have been posted. Some suggestions, some
actual answers.

http://www.google.com/groups?as_q=wi...=&num=50&hl=en


A lot of examples of programs without semicolon have been posted, but
that is not at all what Jeremy asked about. Unless I adopt Dan's
interpretation of "a C program", I still don't see anything which comes
close to Jeremy's specification.

Martin
--
,--. Martin Dickopp, Dresden, Germany ,= ,-_-. =.
/ ,- ) http://www.zero-based.org/ ((_/)o o(\_))
\ `-' `-'(. .)`-'
`-. Debian, a variant of the GNU operating system. \_/
Nov 14 '05 #25

On Wed, 12 May 2004, Dan Pop wrote:

Jeremy Yallop <je****@jdyallop.freeserve.co.uk> writes:
Case <no@no.no> writes:
> Jeremy Yallop wrote:
>> Write a program that takes a C program in source form as input and
>> prints the source code for a program with equivalent behaviour, but
>> without semicolons, on standard output.
>
> Replace all semicolons with NOT_A_SEMICOLON between some white space
> and compile with the appropriate-something-like -DNOT_A_SIMICOLON=;

(s/SIMICOLON/SEMICOLON/ of course.)
No, this doesn't handle semicolons in strings.


This is true, but unimportant: handling character and string literals is
a doable and relatively minor task.


I considered this point when I wrote the "print a semicolon without
using a semicolon" program (which BTW it only now occurs to me could
have been a lot shorter!). As far as I can tell, there is *no* way to
produce the sstring literal ";" nor the character literal ';' in a
confroming C program, without using at least one semicolon.
(Character-encoding-specific hacks excluded, of course.)
Does Dan Pop see something I don't? (That's a common occurrence,
but it strikes me as unlikely in this case.)

-Arthur
Nov 14 '05 #26
Arthur J. O'Dwyer wrote:
On Wed, 12 May 2004, Dan Pop wrote:
Jeremy Yallop <je****@jdyallop.freeserve.co.uk> writes:
>Case <no@no.no> writes:
>
>>Jeremy Yallop wrote:
>>
>>>Write a program that takes a C program in source form as input and
>>>prints the source code for a program with equivalent behaviour, but
>>>without semicolons, on standard output.
>>
>>Replace all semicolons with NOT_A_SEMICOLON between some white space
>>and compile with the appropriate-something-like -DNOT_A_SIMICOLON=;

(s/SIMICOLON/SEMICOLON/ of course.)

No, this doesn't handle semicolons in strings.
This is true, but unimportant: handling character and string literals is
a doable and relatively minor task.

I considered this point when I wrote the "print a semicolon without
using a semicolon" program (which BTW it only now occurs to me could
have been a lot shorter!). As far as I can tell, there is *no* way to
produce the sstring literal ";" nor the character literal ';' in a


(s/sstring/string/ of course.)
confroming C program, without using at least one semicolon.
(s/confroming/conforming/ of course.)
(Character-encoding-specific hacks excluded, of course.)
Does Dan Pop see something I don't? (That's a common occurrence,
but it strikes me as unlikely in this case.)

-Arthur


:-) Kees
Nov 14 '05 #27
In <Pi***********************************@unix41.andr ew.cmu.edu> "Arthur J. O'Dwyer" <aj*@nospam.andrew.cmu.edu> writes:

On Wed, 12 May 2004, Dan Pop wrote:

Jeremy Yallop <je****@jdyallop.freeserve.co.uk> writes:
>>> Case <no@no.no> writes:
>>>> Jeremy Yallop wrote:
>>>>> Write a program that takes a C program in source form as input and
>>>>> prints the source code for a program with equivalent behaviour, but
>>>>> without semicolons, on standard output.
>>>>
>>>> Replace all semicolons with NOT_A_SEMICOLON between some white space
>>>> and compile with the appropriate-something-like -DNOT_A_SIMICOLON=;
(s/SIMICOLON/SEMICOLON/ of course.)
>No, this doesn't handle semicolons in strings.


This is true, but unimportant: handling character and string literals is
a doable and relatively minor task.


I considered this point when I wrote the "print a semicolon without
using a semicolon" program (which BTW it only now occurs to me could
have been a lot shorter!). As far as I can tell, there is *no* way to
produce the sstring literal ";" nor the character literal ';' in a
confroming C program, without using at least one semicolon.
(Character-encoding-specific hacks excluded, of course.)
Does Dan Pop see something I don't? (That's a common occurrence,
but it strikes me as unlikely in this case.)


Since you have the NOT_A_SEMICOLON macro, you can build the ";" string
literal using the method documented in the FAQ. Once you have this
string, it is trivial to obtain the value of the ';' character. No
character set dependencies involved.

Dan
--
Dan Pop
DESY Zeuthen, RZ group
Email: Da*****@ifh.de
Nov 14 '05 #28

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Mage | last post by:
Hello, I amafraid of I will stop using semicolons in other languages after one or two months of python. However I see that python simply ignores the semicolons atd the end of the lines. ...
1
by: jjbutera | last post by:
How do I escape these? The backslash doesn't seem to be working.
4
by: Prowler | last post by:
In the application we are currently building, we need to write positioning code on-the-fly, based upon the screen offset of the element in the AS/400 application which drives the Web app. The 400,...
9
by: Jukka K. Korpela | last post by:
I noticed that Internet Explorer (6.0, on Win XP SP 2, all fixes installed) incorrectly renders e.g. &harr &euro &Omega literally and not as characters denoted by the entities, but if a semicolon...
17
by: subnet | last post by:
I'm not a C expert, but I've seen this topic discussed in the newsgroup several times. What's the deal with writing such programs? Why are they considered so interesting? Thanks
4
by: Waxhead | last post by:
Hi folks, First of all I'm new to newsgroups so please don't kill me in case I'm breaking any rules , but if you really have to make it quick and painfull ;) What is actually propper hehaviour...
3
by: Stefan Mueller | last post by:
I've a web page with several input boxes. After the user clicks 'submit' I insert these data into my MySQL database. This worked for several months perfect. But today a user entered the street...
12
by: feel | last post by:
Hi,All I am sure it's an old question. But I just find a interesting design about this: Polymorphism without virtual function in a C++ class. My solution is for some special case, trust me, very...
0
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...
0
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
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
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
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
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...
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
0
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.