Sponsored Content
Full Discussion: compile a c program
Top Forums Programming compile a c program Post 302169581 by djehresmann on Thursday 21st of February 2008 03:55:44 PM
Old 02-21-2008
Ok, no matter where it put it I get the same reply.

/*
Listing 5 get_epoch_secs.c
get_epoch_secs.c
return the number of seconds from the Epoch
*/
#include <stdio.h>
#include <time.h>

void main(argc, argv)
int argc;
char **argv;
{
time_t tloc;

printf("%ld", time(&tloc));
}



Where should it go?


thanks.
 

10 More Discussions You Might Find Interesting

1. Programming

how to compile a program

how do i go about compiling a simple hello world script in mandrake linux? this is something i have had no luck in finding on the main site, please help? thank you (2 Replies)
Discussion started by: CmpKillr
2 Replies

2. Programming

How to compile a c program by using gcc

Hi all, Yeasterday I try to compile c program by using cygwin. I just find an errors the fist one is concerinig about the end of the line. To summit my Assignment which is the day after tommorow I have to compile my c program by using just gcc. If any one know what do I have to... (5 Replies)
Discussion started by: Bell
5 Replies

3. Programming

how to compile a program statically

how can i do static compilation in cc and -lldap i have system defined and user defined header file. Can any one suggest any site where from i can get some information about static and dynamic compilation. Thankx (1 Reply)
Discussion started by: bhakti
1 Replies

4. BSD

How to compile a c program in freeBSD

Hi , I have freeBSD installed. I need to compile a c program which has embedded informix sql statement in it. Can you please help me to to do the same. I need to know what I should I do to make BSD compatable to compile the c program ? Thanks in advance Jisha (3 Replies)
Discussion started by: jisha
3 Replies

5. Programming

Compile c program on Sun Solaris OS

Can anyone tell me how to compile a c programs on SunSolaris OS 5.1 Version as gcc and cc are not working Thanks!!!! (4 Replies)
Discussion started by: shivu
4 Replies

6. Programming

compile a program in C with teradata sentences using cc

hi, I want to compile a program in C. It have a multiple calls to teradata. I have no idea how to compile in Aix. The compiler that I should be use is cc. I tried cc -G -KPIC tdsfbd0358.c this generates a tdsfbd0358.i and after I have no Idea what I have to make, a link? how?... (3 Replies)
Discussion started by: kajum
3 Replies

7. UNIX for Advanced & Expert Users

compile a c program in a encrypted way

Hi Guys, I wonder I had have a look to the cc compile options but I could be missing one but basically I'm compliling a c program where I will storing a command to connect to a database and also userid and password. The issue is that after the module is generated using a command like strings I... (14 Replies)
Discussion started by: arizah
14 Replies

8. Programming

Not able to compile C program on z/OS (USS)

Hi, I having an issue while compiling a C program in USS (z/OS) machine. I was able to create objest files (.o) from source (.c) files but when I try to create a binary file from the object files I am getting the below error. $ cc util.o sock.o app.o -lnsl -o ptf FSUM3067 The archive... (7 Replies)
Discussion started by: madhu84
7 Replies

9. UNIX and Linux Applications

Cannot compile/install gnu program

Hello, I'm trying to install ansifilter which is a program that translates ansi text to HTML. The idea is to install it on AIX 7.1 but is failing. All de appropriate gcc libraries and requirements for this software were installed successfully, but when I do the gmake I get the following... (4 Replies)
Discussion started by: bazajav
4 Replies

10. Programming

How to compile and run the ProC (*.pc) program?

Hi Team, I am very new to this forum and hope someone will help me in resolving the issue. I am new to Pro C also. I made some changes to the existing Pro C program and want to run the program with the changes. But I am unable to neither compile nor run the program. Please do the... (2 Replies)
Discussion started by: prakashs1218
2 Replies
time(3) 						     Library Functions Manual							   time(3)

NAME
time, time64, TIMET32TO64, TIMET64TO32 - Gets time, converts time between time_t and time64_t LIBRARY
Standard C Library (libc.so, libc.a) SYNOPSIS
#include <time.h> time_t time( time_t *tloc); The following data type, function declaration and macros are Compaq extensions and do not conform to current standards. These features are provided to support the time64_t data type and are accessible only when the _TIME64_T feature macro is defined during compilation. #include <time.h> typedef long time64_t; time64_t time64( time64_t *tloc64); void TIMET32TO64(t32, t64) int TIMET64TO32(t64, t32) PARAMETERS
Points to the location where the return value of type time_t is stored. When this parameter is a null pointer, no value is stored. Points to the location where the return value of type time64_t is stored. When this parameter is a null pointer, no value is stored. Refers to a variable of type time_t. Refers to a variable of type time64_t. DESCRIPTION
The time() function returns the time in seconds since the Epoch. The Epoch is referenced to 00:00:00 CUT (Coordinated Universal Time) 1 Jan 1970. The time64_t data type is a 64-bit signed value which, like the 32-bit time_t data type, is defined as the "time in seconds since the Epoch." It is provided for storage and manipulation of times beyond the range of a 32-bit time_t (Dec 13 20:45:52 GMT 1901 through Jan 19 03:14:07 GMT 2038). This data type is only available when the _TIME64_T feature macro is defined during compilation. The time64() function works exactly as the time() function, but uses the larger time64_t type (referenced by the tloc64 pointer) instead of time_t. The current system time setting limits (Jan 1 00:00:00 GMT 1970 through Jan 19 03:14:07 GMT 2038) are not changed by this function or the time64_t data type. This function declaration is only available when the _TIME64_T feature macro is defined during compilation. The TIMET32TO64() and TIMET64TO32() macros are provided to assist developers converting between values of type time_t and values of type time64_t. The TIMET32TO64() macro converts the value contained in t32 to a value of type time64_t and stores the result in t64, performing sign-extension as appropriate. The TIMET64TO32() macro attempts to convert the value contained in t64 to a value of type time_t, storing the result in t32. If the value of t64 overflows the size of a time_t, the value of the TIMET64TO32() macro will be 1 and the value of t32 is undefined. Otherwise, the value of the TIMET64TO32() macro will be 0 and t32 will contain the converted value from t64. These conversion macros are only available when the _TIME64_T feature macro is defined during compilation. RETURN VALUES
Upon successful completion, the time() function returns the value of time in seconds since the Epoch. Otherwise, the value (time_t)-1 is returned. Upon successful completion, the time64() function returns the value of time in seconds since the Epoch. Otherwise, the value (time64_t)-1 is returned. RELATED INFORMATION
Functions: gettimeofday(2), clock(3), ctime(3), difftime(3), stime(3), strftime(3), strptime(3) Standards: standards(5) delim off time(3)
All times are GMT -4. The time now is 09:59 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy