473,883 Members | 1,763 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Printing "hello , wolrd" with out using semicolon

Hi,
Can any body tell me how to print "hello,worl d" with out using semicolon

Thanks in advance ..
Bye
Prashanth Badabagni
Nov 14 '05
42 9913
rl*@hoekstra-uitgeverij.nl (Richard Bos) wrote in message news:<40******* *********@news. individual.net> ...
ai***@acay.com. au (Peter Nilsson) wrote:
"Arthur J. O'Dwyer" <aj*@nospam.and rew.cmu.edu> wrote in message
#define P(x) printf(#x
#define L(x) #x
#define S L(| |)[!Z]
int f(int l,int i){if((i=l,!Z)& &l==Z&&P(%c%c%d \n),S,S,Z)&&f
(++i,i)){}else if(--l==Z&&P(\n))&&f (++i,i)){}else if(--l==Z


The \ in \n is not at the end of a line, not part of a character or
string literal, not part of a universal character, not part of an
include header, and does not constitute a punctuator or other
preprocessor token.


Macro processing, including # stringising macros, is done in translation
phase 4; escape sequences are translated in phase 5.


But conversion to preprocessing tokens occurs in phase 3, by which
time an isolated backslash character like the one above is _not_ a
preprocessor token.

--
Peter
Nov 14 '05 #41
ai***@acay.com. au (Peter Nilsson) writes:
rl*@hoekstra-uitgeverij.nl (Richard Bos) wrote in message news:<40******* *********@news. individual.net> ...
ai***@acay.com. au (Peter Nilsson) wrote:
> "Arthur J. O'Dwyer" <aj*@nospam.and rew.cmu.edu> wrote in message
> > #define P(x) printf(#x
> > #define L(x) #x
> > #define S L(| |)[!Z]
> > int f(int l,int i){if((i=l,!Z)& &l==Z&&P(%c%c%d \n),S,S,Z)&&f
> > (++i,i)){}else if(--l==Z&&P(\n))&&f (++i,i)){}else if(--l==Z
>
> The \ in \n is not at the end of a line, not part of a character or
> string literal, not part of a universal character, not part of an
> include header, and does not constitute a punctuator or other
> preprocessor token.


Macro processing, including # stringising macros, is done in translation
phase 4; escape sequences are translated in phase 5.


But conversion to preprocessing tokens occurs in phase 3, by which
time an isolated backslash character like the one above is _not_ a
preprocessor token.


Why not? 6.4#3:

| [...] A preprocessing token is the minimal lexical element of the
| language in translation phases 3 through 6. The categories of
| preprocessing tokens are: header names, identifiers, preprocessing
| numbers, character constants, string literals, punctuators, and single
| non-white-space characters that do not lexically match the other
| preprocessing token categories. [...]

A single backslash character seems to fit into the last category.

Martin
--
,--. Martin Dickopp, Dresden, Germany ,= ,-_-. =.
/ ,- ) http://www.zero-based.org/ ((_/)o o(\_))
\ `-' `-'(. .)`-'
`-. Debian, a variant of the GNU operating system. \_/
Nov 14 '05 #42
Martin Dickopp <ex************ ****@zero-based.org> wrote in message news:<cu******* ******@zero-based.org>...
ai***@acay.com. au (Peter Nilsson) writes:
rl*@hoekstra-uitgeverij.nl (Richard Bos) wrote in message news:<40******* *********@news. individual.net> ...
ai***@acay.com. au (Peter Nilsson) wrote:

> "Arthur J. O'Dwyer" <aj*@nospam.and rew.cmu.edu> wrote in message
> > #define P(x) printf(#x
> > #define L(x) #x
> > #define S L(| |)[!Z]
> > int f(int l,int i){if((i=l,!Z)& &l==Z&&P(%c%c%d \n),S,S,Z)&&f
> > (++i,i)){}else if(--l==Z&&P(\n))&&f (++i,i)){}else if(--l==Z
>
> The \ in \n is not at the end of a line, not part of a character or
> string literal, not part of a universal character, not part of an
> include header, and does not constitute a punctuator or other
> preprocessor token.

Macro processing, including # stringising macros, is done in translation
phase 4; escape sequences are translated in phase 5.


But conversion to preprocessing tokens occurs in phase 3, by which
time an isolated backslash character like the one above is _not_ a
preprocessor token.


Why not? 6.4#3:

| [...] A preprocessing token is the minimal lexical element of the
| language in translation phases 3 through 6. The categories of
| preprocessing tokens are: header names, identifiers, preprocessing
| numbers, character constants, string literals, punctuators, and single
| non-white-space characters that do not lexically match the other
| preprocessing token categories. [...]

A single backslash character seems to fit into the last category.


Yup, my (very) bad.

--
Peter
Nov 14 '05 #43

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

Similar topics

33
5594
by: ankursinha | last post by:
Hi, Is it possible to write a C program that prints "Hello World" on screen without having a single semi-colon in the entire program? The extra constraint here is that u r not allowed to use if,while,switch etc. So far,i figured this could be done by insertint the printf statement in main as shown: int main(int argc=printf("Hello world")
51
4195
by: Spidey | last post by:
for(;0;) printf("hello"); even the condition s wrong i get a hello printed on the screen y s this happening
0
9944
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
1
10863
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9586
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7977
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
7136
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
6005
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4622
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 we have to send another system
2
4228
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
3241
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.