SOURCE CODE FOR DIGITAL CLOCK IN C LANGUAGE

M

mohsinalishah444

Dear All,
PLZ TELL ME THE SOURCE CODE OF DIGITAL CLOCK IN
C LANGUAGE . I REALLY NEED IT AND I DONOT KNOW HOW TO USE C LANGUAGE .
ACTUALLY I WANT TO MAKE A CLOCK IN LINUX >IF ANY BODY POST ME THE
CODE I HALL BEW VERY THANKFUL TO HOM> PLZ DO REPLY ME PLZ
 
I

Ian Collins

Dear All,
PLZ TELL ME THE SOURCE CODE OF DIGITAL CLOCK IN
C LANGUAGE . I REALLY NEED IT AND I DONOT KNOW HOW TO USE C LANGUAGE .
ACTUALLY I WANT TO MAKE A CLOCK IN LINUX >IF ANY BODY POST ME THE
CODE I HALL BEW VERY THANKFUL TO HOM> PLZ DO REPLY ME PLZ
DON'T SHOUT!

Unless you are using a teletype.
 
M

Mark McIntyre

On Thu, 14 Jun 2007 02:29:43 -0700, in comp.lang.c ,
Dear All,
PLZ TELL ME THE SOURCE CODE OF DIGITAL CLOCK IN
C LANGUAGE . I REALLY NEED IT AND I DONOT KNOW HOW TO USE C LANGUAGE .
ACTUALLY I WANT TO MAKE A CLOCK IN LINUX >IF ANY BODY POST ME THE
CODE I HALL BEW VERY THANKFUL TO HOM> PLZ DO REPLY ME PLZ

TypinG ENTIRELY IN UPPERCASE is regarded as shouting on usenet. You
should use normal sentence case.

As for the question, this isn't comp.sources.wanted. If you try to
write the programme yourself first, then people will be happy to show
where you've gone wrong.

If you want some hints, look at the time() and mktime() functions and
the various structs associated with them. These will get you started.

--
Mark McIntyre

"Debugging is twice as hard as writing the code in the first place.
Therefore, if you write the code as cleverly as possible, you are,
by definition, not smart enough to debug it."
--Brian Kernighan
 
S

Serve Laurijssen

Dear All,
PLZ TELL ME THE SOURCE CODE OF DIGITAL CLOCK IN
C LANGUAGE . I REALLY NEED IT AND I DONOT KNOW HOW TO USE C LANGUAGE .
ACTUALLY I WANT TO MAKE A CLOCK IN LINUX >IF ANY BODY POST ME THE
CODE I HALL BEW VERY THANKFUL TO HOM> PLZ DO REPLY ME PLZ

#include <stdio.h>

#define PUTS puts
#define MAIN main
#define INT in

INT MAIN()
{
PUTS("THE TIME IS NOW 4:41PM, MIGHT BE INCORRECT THOUGH");
}
 
K

Kenneth Brody

Serve said:
#include <stdio.h>

#define PUTS puts
#define MAIN main
#define INT in s/in/int/

INT MAIN()
{
PUTS("THE TIME IS NOW 4:41PM, MIGHT BE INCORRECT THOUGH");
}


ITYM:


#define STDIO <stdio.h>
#define PUTS(TEXT) puts(TEXT);
#define MAIN main(void)
#define INT int
#define BEGIN {
#define END }
#define CLOCK "THE TIME IS NOW 12:06PM, MIGHT BE INCORRECT THOUGH"

/************* BEGIN MAIN PROGRAM *************/

#include STDIO

INT MAIN BEGIN PUTS(CLOCK) END


--
+-------------------------+--------------------+-----------------------+
| Kenneth J. Brody | www.hvcomputer.com | #include |
| kenbrody/at\spamcop.net | www.fptech.com | <std_disclaimer.h> |
+-------------------------+--------------------+-----------------------+
Don't e-mail me at: <mailto:[email protected]>
 
L

Lew Pitcher

ITYM:

#define STDIO <stdio.h>

/*> #define PUTS(TEXT) puts(TEXT); */

/* perhaps a bit "better" form. at least safe from embedded escape
sequences */
#define PUTS(TEXT) puts("%s\n",TEXT);
 
L

Lew Pitcher

/*> #define PUTS(TEXT) puts(TEXT); */

/* perhaps a bit "better" form. at least safe from embedded escape
sequences */
#define PUTS(TEXT) puts("%s\n",TEXT);

Gaak! Ignore that. I misread puts() as printf(). Sorry
 
C

Clever Monkey

PLZ TELL ME THE SOURCE CODE OF DIGITAL CLOCK IN
C LANGUAGE . I REALLY NEED IT AND I DONOT KNOW HOW TO USE C LANGUAGE .
ACTUALLY I WANT TO MAKE A CLOCK IN LINUX >IF ANY BODY POST ME THE
CODE I HALL BEW VERY THANKFUL TO HOM> PLZ DO REPLY ME PLZ
Stop shouting. We can hear you, even back here in the cheap seats.

Go find "grdc", available in any BSD code repository. Should port to
Linux easily (if it hasn't already been ported).
 
S

shadowman

Dear All,
PLZ TELL ME THE SOURCE CODE OF DIGITAL CLOCK IN
C LANGUAGE . I REALLY NEED IT AND I DONOT KNOW HOW TO USE C LANGUAGE .
ACTUALLY I WANT TO MAKE A CLOCK IN LINUX >IF ANY BODY POST ME THE
CODE I HALL BEW VERY THANKFUL TO HOM> PLZ DO REPLY ME PLZ

/bin/date
 
H

Hyuga

Dear All,
PLZ TELL ME THE SOURCE CODE OF DIGITAL CLOCK IN
C LANGUAGE . I REALLY NEED IT AND I DONOT KNOW HOW TO USE C LANGUAGE .
ACTUALLY I WANT TO MAKE A CLOCK IN LINUX >IF ANY BODY POST ME THE
CODE I HALL BEW VERY THANKFUL TO HOM> PLZ DO REPLY ME PLZ

Not to indulge, but here's THE SOURCE CODE OF DIGITAL CLOCK IN C
LANGUAGE FOR LINNOCKS!!!!

#include <unistd.h>
int main(void) {
execv("/bin/date", NULL);
return 0;
}

Enjoy!

Hyuga
 
M

mohsinalishah444

dear all
i try to build the digital clock but it has some problems
and errors plz remove those erros and help me . i am sending the code
plz debug it

i shall be very thankful to u for this act of kindness


the code is as below

#include<conio.h>
#include<stdio.h>
#include<graphics.h>
using System;
using System.WinForms;
using System.Drawing;
using System.Drawing.Drawing2D;
using System.Drawing.Imaging;
public class h2:Form
{
private Image []image=new Bitmap[10];
private Image colon=null;
Timer t=new Timer();
Rectangle rec=new Rectangle(50,50,100,100);
h2()
{
for(int x=0;x<10;x++)
image[x]=new Bitmap(x+".gif");
colon=new Bitmap("colon.gif");
this.Size=new Size(350,50);
this.BorderStyle=FormBorderStyle.None;
this.BackgroundImage=new Bitmap("back5.gif");
this.StartPosition=FormStartPosition.Manual;
this.DesktopLocation=new Point(400,0);
this.ShowInTaskbar=false;
this.TopMost=true;
this.Opacity=0.50;
t.Interval=1000;
t.Tick+=new EventHandler(draw1);
t.Enabled=true;
}
protected override void OnPaint(PaintEventArgs a)
{
Graphics g=a.Graphics;
int hh=DateTime.Now.Hour;
int hh1=hh/10;
int hh2=hh%10;
g.DrawImage(image[hh1],0,1,40,40);
g.DrawImage(image[hh2],40,1,40,40);
g.DrawImage(colon,80,5,30,30);
int mm=DateTime.Now.Minute;
int mm1=mm/10;
int mm2=mm%10;
g.DrawImage(image[mm1],115,1,40,40);
g.DrawImage(image[mm2],155,1,40,40);
g.DrawImage(colon,195,5,30,30);
int ss=DateTime.Now.Second;
int ss1=ss/10;
int ss2=ss%10;
g.DrawImage(image[ss1],230,1,40,40);
g.DrawImage(image[ss2],285,1,40,40);
}
public void draw1(object ob,EventArgs a)
{
this.Invalidate();
}
public static void Main()
{
Application.Run(new h2());
}
}
 
R

Richard Heathfield

(e-mail address removed) said:
dear all
i try to build the digital clock but it has some problems
and errors plz remove those erros and help me . i am sending the code
plz debug it

I've removed all the errors, as you asked. There's nothing left.
 
C

Chris Dollin

dear all
i try to build the digital clock but it has some problems
and errors plz remove those erros and help me . i am sending the code
plz debug it

fr gdz sk dn't brvt lk tht -- ts hrd t rd.
i shall be very thankful to u for this act of kindness


the code is as below

#include<conio.h>
#include<stdio.h>
#include<graphics.h>
using System;
using System.WinForms;
using System.Drawing;
using System.Drawing.Drawing2D;
using System.Drawing.Imaging;
public class h2:Form

Um. This isn't C code. If I had to guess I'd guess C#, which isn't C;
it's a dramatically different language with some similar bits of
syntax. You need a C# group or an MS group with C# expertise.
 
M

Martin Ambuhl

dear all
i try to build the digital clock but it has some problems
and errors plz remove those erros and help me . i am sending the code
plz debug it

i shall be very thankful to u for this act of kindness


the code is as below

#include<conio.h>
#include<stdio.h>
#include<graphics.h>

Neither <conio.h> nor <graphics.h> is a standard C header. You should
post to a newsgroup for whatever implementation uses those things, not
comp.lang.c.
using System;
using System.WinForms;
using System.Drawing;
using System.Drawing.Drawing2D;
using System.Drawing.Imaging;

All of the 5 lines above are syntax errors. There are no "using"
statements in C. You should post questions about whatever language you
are using to a newsgroup for that language. It sure is *not* C.

Every one of the remaining lines of your code is similarly neither C nor
topical here.

You have only three lines which are not syntax errors, the three
includes. If this non-C mess is actually C++, before you post to some
other newsgroup change the only line of your post with a defined meaning
in standard C
> #include<stdio.h>
to be C++:
#include <cstdio>

With the appropriate headers and associated libraries
> #include<conio.h> and
> #include<graphics.h>
are legal lines of C, but since <conio.h> and <graphics.h> have no
meaning within the defined standard C language, the lines are not more
meaningful than
public class h2:Form
{
private Image []image=new Bitmap[10];
private Image colon=null;
Timer t=new Timer();
Rectangle rec=new Rectangle(50,50,100,100);
h2()
{
for(int x=0;x<10;x++)
image[x]=new Bitmap(x+".gif");
colon=new Bitmap("colon.gif");
this.Size=new Size(350,50);
this.BorderStyle=FormBorderStyle.None;
this.BackgroundImage=new Bitmap("back5.gif");
this.StartPosition=FormStartPosition.Manual;
this.DesktopLocation=new Point(400,0);
this.ShowInTaskbar=false;
this.TopMost=true;
this.Opacity=0.50;
t.Interval=1000;
t.Tick+=new EventHandler(draw1);
t.Enabled=true;
}
protected override void OnPaint(PaintEventArgs a)
{
Graphics g=a.Graphics;
int hh=DateTime.Now.Hour;
int hh1=hh/10;
int hh2=hh%10;
g.DrawImage(image[hh1],0,1,40,40);
g.DrawImage(image[hh2],40,1,40,40);
g.DrawImage(colon,80,5,30,30);
int mm=DateTime.Now.Minute;
int mm1=mm/10;
int mm2=mm%10;
g.DrawImage(image[mm1],115,1,40,40);
g.DrawImage(image[mm2],155,1,40,40);
g.DrawImage(colon,195,5,30,30);
int ss=DateTime.Now.Second;
int ss1=ss/10;
int ss2=ss%10;
g.DrawImage(image[ss1],230,1,40,40);
g.DrawImage(image[ss2],285,1,40,40);
}
public void draw1(object ob,EventArgs a)
{
this.Invalidate();
}
public static void Main()
{
Application.Run(new h2());
}
}
 
R

Richard Heathfield

Martin Ambuhl said:

Every one of the remaining lines of your code is similarly neither C
nor topical here.

You have only three lines which are not syntax errors, the three
includes. If this non-C mess is actually C++,

It isn't.
 
C

CBFalconer

i try to build the digital clock but it has some problems and
errors plz remove those erros and help me . i am sending the code
plz debug it

i shall be very thankful to u for this act of kindness

the code is as below

#include<conio.h>
no such standard include file
#include<stdio.h>
#include<graphics.h>
no such standard include file
using System;
using System.WinForms;
using System.Drawing;
using System.Drawing.Drawing2D;
using System.Drawing.Imaging;
public class h2:Form

None of the above lines make any sense in standard C.

In other words you are either on the wrong newsgroup or mightily
confused.

BTW, u has not posted on this newsgroup for a long time. The
personal pronoun 'I' is normally capitalized.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,482
Members
44,901
Latest member
Noble71S45

Latest Threads

Top