Sponsored Content
Full Discussion: compile funtion
Top Forums Programming compile funtion Post 13926 by sundarm on Friday 25th of January 2002 08:19:52 AM
Old 01-25-2002
Question compile funtion

Hi,

This is the first time, i am doing UNIX & C stuff.

I have written one funtion like

#include <stdio.h>
seq(num)
int num;
{
int i,sum;
for (i=1; i<=num;i++)
sum+=i;
return(sum);
}

this seq funtion should have return values to unix script.
like

..
a=$(seq 10)
print $a
..

problem is, when i tried to compile above funtion, system gives

/usr/ccs/bin/ld: Unsatisfied symbols:
main

Is there any way to compile without main function. I am using HP-UX 11.0 and compiler is cc.

Thanks in advance
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

i see "{}" in various commands around here what is there funtion?

IE: find / -type f -exec grep email@host {} /dev/null \; or find /home/domains/*/ -type d -exec chmod 777 {} \; is the {} \; part of the -type funciton? this is what i understand about the following commands. 1) start the find at the root dir. a) only looking for flatfiles b)... (4 Replies)
Discussion started by: Optimus_P
4 Replies

2. Post Here to Contact Site Administrators and Moderators

Delete funtion

Neo, eariler today i had tossed up a post then realized i didnt want it up so i tried to delete it and it wouldnt let me. is this a functionality that you have active? To allow a user to delete any topic they started would be a great thing, i think it will also help on not haveing double posts... (2 Replies)
Discussion started by: Optimus_P
2 Replies

3. SCO

Unable to use funtion keys with Kea term

Hi I have a server SCO_SV mantrak 3.2 5.0.5 i386 and i use a terminal emulator called Kea 420 term ! when i log in to the session i am unable to use the funtions keys then i reset the server and works fine just some minutes any comment ? i really apreciate your help regards... (1 Reply)
Discussion started by: Rdavila
1 Replies

4. Cybersecurity

Hash Funtion properties

Here are some desirable properties for cryptographic hash functions: These properties below are generally considered prerequisites: * Preimage resistant: given h it should be hard to find any m such that h = hash(m). * Second preimage resistant: given an input m1, it should be hard... (1 Reply)
Discussion started by: newkidintown
1 Replies

5. Programming

help to compile

Hello everybody, I have a small opensource project http://hpaftpd.sourceforge.net (single-threaded ftp-server). It tested with FreeBSD and Linux. Can anybody try it with another UNIX system ? I'm interesting about HP/UX and Solaris. I would very much appreciate receiving any results about it. ... (2 Replies)
Discussion started by: wwwdev
2 Replies

6. Shell Programming and Scripting

Shell Script not working using for loop and a funtion

Hi- Here is the shell script that for some reason is not returning results: #! /bin/ksh - avg() { AVG=0 typeset SUM=0 if then echo "You must have at least two numbers" else for NUM in "$*" do ... (2 Replies)
Discussion started by: koomba
2 Replies

7. UNIX for Dummies Questions & Answers

Compiling gcc to compile make to compile yaboot

I have just installed OpenBSD on a 333MHz PPC iMac G3. It has a 6GB HDD that has been partitioned as 1GB MacOS 8.5.1, 3GB MacOS X 10.3.9, 2GB OpenBSD 4.8. I now need to install a bootloader so that my computer can recognize the OpenBSD partition at startup. I have been trying to install... (0 Replies)
Discussion started by: t04st3r
0 Replies

8. Shell Programming and Scripting

how to check/display/edit funtion

Hi, I have this output: $ type msq msq is a function I thought it an alias, can you tell me how to I can find this function and where ? Thanks for help. I'm on RH and HP-UX Best T Continued here (0 Replies)
Discussion started by: trento17
0 Replies

9. Shell Programming and Scripting

multiple looping with case and funtion showing error, Please help

Hello All, I have code as follows :- while true do {opening a case1 statement} 1) {opening another case2 statement} {closing case 2} 2) Showing error for "2)" as Syntax error at line 59 : `)' is not expected. *) {closing case 1} ... (5 Replies)
Discussion started by: Renjesh
5 Replies

10. Shell Programming and Scripting

find -exec How to add additional parameter when calling a funtion

Hello Current working script is : # # my_script BEGIN # function a_function { FIRST_PARAM="$1" DO_SOMETHING "$FIRST_PARAM" } export -f a_function START_HERE="/home/some_user/Documents" find $START_HERE" -exec bash -c 'a_function "$0" ' {} \; (5 Replies)
Discussion started by: jcdole
5 Replies
Num(3o)                                                            OCaml library                                                           Num(3o)

NAME
Num - Operation on arbitrary-precision numbers. Module Module Num Documentation Module Num : sig end Operation on arbitrary-precision numbers. Numbers (type num ) are arbitrary-precision rational numbers, plus the special elements 1/0 (infinity) and 0/0 (undefined). type num = | Int of int | Big_int of Big_int.big_int | Ratio of Ratio.ratio The type of numbers. === Arithmetic operations === val (+/) : num -> num -> num Same as Num.add_num . val add_num : num -> num -> num Addition val minus_num : num -> num Unary negation. val (-/) : num -> num -> num Same as Num.sub_num . val sub_num : num -> num -> num Subtraction val ( */ ) : num -> num -> num Same as Num.mult_num . val mult_num : num -> num -> num Multiplication val square_num : num -> num Squaring val (//) : num -> num -> num Same as Num.div_num . val div_num : num -> num -> num Division val quo_num : num -> num -> num Euclidean division: quotient. val mod_num : num -> num -> num Euclidean division: remainder. val ( **/ ) : num -> num -> num Same as Num.power_num . val power_num : num -> num -> num Exponentiation val abs_num : num -> num Absolute value. val succ_num : num -> num succ n is n+1 val pred_num : num -> num pred n is n-1 val incr_num : num Pervasives.ref -> unit incr r is r:=!r+1 , where r is a reference to a number. val decr_num : num Pervasives.ref -> unit decr r is r:=!r-1 , where r is a reference to a number. val is_integer_num : num -> bool Test if a number is an integer === The four following functions approximate a number by an integer : === val integer_num : num -> num integer_num n returns the integer closest to n . In case of ties, rounds towards zero. val floor_num : num -> num floor_num n returns the largest integer smaller or equal to n . val round_num : num -> num round_num n returns the integer closest to n . In case of ties, rounds off zero. val ceiling_num : num -> num ceiling_num n returns the smallest integer bigger or equal to n . val sign_num : num -> int Return -1 , 0 or 1 according to the sign of the argument. === Comparisons between numbers === val (=/) : num -> num -> bool val (</) : num -> num -> bool val (>/) : num -> num -> bool val (<=/) : num -> num -> bool val (>=/) : num -> num -> bool val (<>/) : num -> num -> bool val eq_num : num -> num -> bool val lt_num : num -> num -> bool val le_num : num -> num -> bool val gt_num : num -> num -> bool val ge_num : num -> num -> bool val compare_num : num -> num -> int Return -1 , 0 or 1 if the first argument is less than, equal to, or greater than the second argument. val max_num : num -> num -> num Return the greater of the two arguments. val min_num : num -> num -> num Return the smaller of the two arguments. === Coercions with strings === val string_of_num : num -> string Convert a number to a string, using fractional notation. val approx_num_fix : int -> num -> string See Num.approx_num_exp . val approx_num_exp : int -> num -> string Approximate a number by a decimal. The first argument is the required precision. The second argument is the number to approximate. Num.approx_num_fix uses decimal notation; the first argument is the number of digits after the decimal point. approx_num_exp uses scien- tific (exponential) notation; the first argument is the number of digits in the mantissa. val num_of_string : string -> num Convert a string to a number. === Coercions between numerical types === val int_of_num : num -> int val num_of_int : int -> num val nat_of_num : num -> Nat.nat val num_of_nat : Nat.nat -> num val num_of_big_int : Big_int.big_int -> num val big_int_of_num : num -> Big_int.big_int val ratio_of_num : num -> Ratio.ratio val num_of_ratio : Ratio.ratio -> num val float_of_num : num -> float OCamldoc 2012-06-26 Num(3o)
All times are GMT -4. The time now is 04:45 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy