Help Please, Beginner Question, rewrite loop
Hello, I'm really new to C programming, just started about a week and a half ago.
I worked with Visual Basic 6.0 last year, but i've forgotten alot since then. It appears my previous experience isn't much of a help with the higher languages.
But to the question.
How would I write a loop equivalent to the FOR loop below without using && or ||?
It's from the ANSI C book by Brian Kernighhan, Dennis Ritchie.
Code:
#include <stdio.h>
/* easy version, with && and || */
main()
{
int i;
int lim;
int c;
int s[100];
for (i=0; i<lim-1 && (c=getchar()) != '\n' && c != EOF; ++i)
s[i] = c;
}