473,698 Members | 2,298 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

what does "for( ; ; )" mean in C program

hello group,
what does for( ; ; ) mean in C program

Thanks
Feb 1 '08 #1
13 10652
In article <25************ *************** *******@j20g200 0hsi.googlegrou ps.com>,
bobby <bs*****@gmail. comwrote:
>what does for( ; ; ) mean in C program
This is a loop.

Do no initializations .

Do not test any condition to see whether you should continue.

Do not do anything after the end of a loop before the beginning
of the next loop through.
In summary: for(;;) is another way of writing while (1)
which is an infinite loop (unless broken out of somewhere
in the middle.)
--
'Roberson' is my family name; my given name is 'Walter'.
Feb 1 '08 #2
On Feb 1, 3:52 pm, rober...@ibd.nr c-cnrc.gc.ca (Walter Roberson)
wrote:
In article <25dd47d5-b599-4ed0-8f9d-9b84936a8...@j2 0g2000hsi.googl egroups.com>,

bobby <bsim...@gmail. comwrote:
what does for( ; ; ) mean in C program

This is a loop.

Do no initializations .

Do not test any condition to see whether you should continue.

Do not do anything after the end of a loop before the beginning
of the next loop through.

In summary: for(;;) is another way of writing while (1)
which is an infinite loop (unless broken out of somewhere
in the middle.)
--
'Roberson' is my family name; my given name is 'Walter'.
Thank a lot
Feb 1 '08 #3
bobby wrote:
hello group,
what does for( ; ; ) mean in C program
while (1)

Feb 1 '08 #4
In article <60************ *@mid.individua l.net>,
Martin Ambuhl <ma*****@earthl ink.netwrote:
>bobby wrote:
>hello group,
what does for( ; ; ) mean in C program

while (1)
I always thought it meant:

while(27)

I guess it depends on what part of town you're from.

Feb 1 '08 #5
sid
On Feb 2, 1:48*am, bobby <bsim...@gmail. comwrote:
hello group,
what does for( ; ; ) mean in C program

Thanks
It also means for(;1;);
A 'while()' loop is equivalent to 'for(;;)'
Feb 2 '08 #6
sid <ki***********@ gmail.comwrites :
A 'while()' loop is equivalent to 'for(;;)'
while() is not valid syntax. I think you mean that a while(1)
loop is equivalent to for(;;).
--
char a[]="\n .CJacehknorstu" ;int putchar(int);in t main(void){unsi gned long b[]
={0x67dffdff,0x 9aa9aa6a,0xa77f fda9,0x7da6aa6a ,0xa67f6aaa,0xa a9aa9f6,0x11f6} ,*p
=b,i=24;for(;p+ =!*p;*p/=4)switch(0[p]&3)case 0:{return 0;for(p--;i--;i--)case+
2:{i++;if(i)bre ak;else default:continu e;if(0)case 1:putchar(a[i&15]);break;}}}
Feb 2 '08 #7
Ben Pfaff:
sid <ki***********@ gmail.comwrites :
>A 'while()' loop is equivalent to 'for(;;)'

while() is not valid syntax. I think you mean that a while(1)
loop is equivalent to for(;;).

But the extra-paranoid don't use it coz they don't want 1 to be evaluted
upon every iteration ;-)

--
Tomás Ó hÉilidhe
Feb 2 '08 #8
Harald van Dijk <tr*****@gmail. comwrites:
Some people avoid using while(1) because they have to deal with broken
tools that give warnings for while(1) that they don't give for for(;;).
for(;;) is also one character shorter then while(1). :P

--
Best regards, _ _
.o. | Liege of Serenly Enlightened Majesty of o' \,=./ `o
..o | Computer Science, Michal "mina86" Nazarewicz (o o)
ooo +--<mina86*tlen.pl >--<jid:mina86*jab ber.org>--ooO--(_)--Ooo--
Feb 2 '08 #9
"Michal Nazarewicz" <mi****@tlen.pl wrote in message
news:87******** ****@erwin.mina 86.com...
Harald van Dijk <tr*****@gmail. comwrites:
>Some people avoid using while(1) because they have to deal with broken
tools that give warnings for while(1) that they don't give for for(;;).

for(;;) is also one character shorter then while(1). :P
:^)

Feb 2 '08 #10

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

Similar topics

15
6894
by: lkrubner | last post by:
I want to give users the power to edit files from an easy interface, so I create a form and a PHP script called "fileUpdate". It does a reasonable about of error checking and prints out some errors. It uses fileperms() to get the permissions of the file, and it includes that info in any error message. Today I'm getting the following error message. I've used SmartFtp to go in and set the test file's permissions to 777, but in this error...
0
1199
by: Claudio Grondi | last post by:
Hi, I have just by chance discovered, that Microsoft research works on a kind of programming language called AsmL, and I'm just curious if AsmL, which is using same concept of significant indentation as Python language, was developed fully independently or is there a kind of relationship (same person in developer team, etc.)? Maybe someone can give here some hints?
5
2831
by: Steven T. Hatton | last post by:
I've seen people here write that C++ doesn't support modules. What does that mean? 'Module' is a very nebulous term in my book. It probably means something quite different to me than what it does to people making that comment about C++. Can someone explain what they mean when they say C++ doesn't support modules? -- STH Hatton's Law: "There is only One inviolable Law" KDevelop: http://www.kdevelop.org SuSE: http://www.suse.com...
9
4515
by: Marek Kurowski | last post by:
Yo! What mean when program is ALPHA or BETA version? I suppose it is not release version of program, but I don't know what it exactly mean. What it mean in your opinion? Marek Kurowski
6
8369
by: Juan Romero | last post by:
Guys, Sometimes when you want to open a file, the file is locked for editing for some reason. You are able to see the contents of the file (depending on the program you are using) but you are not able to save your changes to it. I am looking to make a program that can tell me what program is locking the file. Does anyone know how to do this? Thanks!
39
3180
by: utab | last post by:
Dear all, Is there a clear distinction how to decide which functions to be members of a class and which not How is your attitude (Your general way from your experiences ...) "If the function changes the state of the object, it ought to be a member of that object." Reference Accelerated C++, A. Koenig, page 159.
5
2204
by: chandanlinster | last post by:
consider the program, /*********************************************************/ int main() { int a; printf("a = %u\n", a); printf("*a = %u\n", *a); return 0; }
4
3724
by: chandanlinster | last post by:
hello everybody, as i was going through the "printf" man page, i came across this statement. printf("%*d", width, num); what does "*" mean?
8
4588
by: nguillot | last post by:
Hello. If I have the following classes: class B {}; typedef B tB; if A is: class A
0
8598
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9152
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
8885
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,...
1
6515
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
4358
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 last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4612
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3037
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
2320
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
1995
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.