Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

infinite loop

Name: Anonymous 2007-03-16 13:30 ID:Nj7svKi5

Hi I tried this but it doesn't compile, what am i doing wrong??


void main()
{
  char c;
  printf("I'm thinking of a number. Please guess it: ");

  for (int i=0;i<∞;i++) {
    c = getchar();
    putchar(c);
    if (c == '\n')
    {
      printf("Wrong! Try again: ");
    }
  }
}

Name: Anonymous 2007-03-19 8:47 ID:Heaven

>>1
Correction :
#include <stdio.h>
int
main(void)
{
  int i;
  const char *answer = "pedo";
  char guess[6] = { 0 };
  puts("I enjoy loli, what is my name ???");
  fgets(guess, 6, stdin);
  for (i = 1; i > 0; i++)
    puts("This program is bloated and I don't know why lulz");
  return 0;
}

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List