Kitap Arama
> Anasayfa > Kod Bankası > C - Örnek
Üye Menüsü
Merhaba Ziyaretçi
IP: 38.107.191.117

Kullanıcı Adı
Şifre
Anket
Elite Üyelik Sistemi Anket Sonuçları

Gerekli    = %31.8
Gereksiz = %68.2

Dini Kitaplar
Boykot Ediyoruz !
Kimler Var?
US 38.107.x.x
US 38.107.x.x
US Google spider
C - Örnek
Tarih 22/07/2008 16:45 Yazar Coder Hitler 324
Print Pdf RSS

/* Display a software timer. */
#include <stdio.h>
#define DELAY 128000
  struct my_time {
  int hours;
  int minutes;
  int seconds;
  } ;
void display(struct my_time *t);
  void update(struct my_time *t);
  void delay(void);
int main(void)
  {
  struct my_time systime;
systime.hours = 0;
  systime.minutes = 0;
  systime.seconds = 0;
for(;;) {
  update(&systime);
  display(&systime);
  }
return 0;
  }
void update(struct my_time *t)
  {
  t->seconds++;
  if(t->seconds==60) {
  t->seconds = 0;
  t->minutes++;
  }
if(t->minutes==60) {
  t->minutes = 0;
  t->hours++;
  }
if(t->hours==24) t->hours = 0;
  delay();
  }
void display(struct my_time *t)
  {
  printf("%02d:", t->hours);
  printf("%02d:", t->minutes);
  printf("%02d\n", t->seconds);
  }
void delay(void)
  {
  long int t;
/* change this as needed */
  for(t=1; t<DELAY; ++t) ;
  }



Kaynak: SELAM.tk
Tags - Del Tec Bli Spu Dig
Yorum Yok.
[ ResetAt.Com - Bir Mcht Sitesidir. ]   

ResetAt.Com   © 2010

Ziyaretçi İzlenimi Aldık
Kapat !