Sponsored Content
Top Forums Programming to compare two integer values stored in char pointers Post 302265275 by Franklin52 on Saturday 6th of December 2008 09:36:51 AM
Old 12-06-2008
Have you tried the atoi() function?

Regards
 

10 More Discussions You Might Find Interesting

1. Programming

C snipet on char Pointers

I have small Dout. please respond. char *p; p=" I am a Very good boy"; Is this valid or not? If not valid why is it so? It is not giving any compilation error. Thanks Vinod (3 Replies)
Discussion started by: gandhevinod
3 Replies

2. Shell Programming and Scripting

Compare integer value with decimal

Hi all, I have a issue... Is it possible to compare integer value with decimal value. If it is not possible,then how can i compare 2 decimal values in born shell.thanks! (3 Replies)
Discussion started by: MARY76
3 Replies

3. UNIX for Advanced & Expert Users

test the string is char or integer

How will test the string contains numeric character or alphabet, is there any script to test ? (10 Replies)
Discussion started by: rajesh08
10 Replies

4. Shell Programming and Scripting

how to compare string & integer in unix

Hi All, i am doung sup up of amount column in my file. tot_val=`awk '{a+=$0}END{printf "%.5f\n",a}' amount` then i have a checksum in footer. chk_sum=`tail -1 $FILE_NAME | cut -d~ -f7 | cut -c2-` but the problem is while executing 1st command i am getting : 27720.75000 & while... (3 Replies)
Discussion started by: Amit.Sagpariya
3 Replies

5. Shell Programming and Scripting

Compare two files based on integer part only

Please see how can I do this: File A (three columns): X1,Y1,1.01 X2,Y2,2.02 X3,Y3,4.03 File B (three columns): X1,Y1,1 X2,Y2,2 X3,Y3,4.0005 Now I have to compare file A and B based on the integer part of column 3. Means first 2 rows should be OK and the third row should not satisfy... (12 Replies)
Discussion started by: yale_work
12 Replies

6. UNIX for Dummies Questions & Answers

compare decimal and integer values in if in bash shell

i need to do camparisions like the below. For the case when first=10 and second=9.9 the scripts displays process failed. I need to be able to convert the values to integer before doing the comparision. Like 9.9 should be rounded over to 10 before doing comparision. Please advice how can... (3 Replies)
Discussion started by: nehagupta
3 Replies

7. Programming

I don't know how to replace input char with appropriate integer

Hi guys, I asked for help on programming forums and no one didn't helped me so I ask for help here. I am playing with some tasks from my book and I can't figure where did I get wrong. From the first program I get a blank screen, program won't generate 10*10 matrix. And second problem is I... (6 Replies)
Discussion started by: solaris_user
6 Replies

8. Shell Programming and Scripting

how to compare string integer with an integer?

hi, how to I do this? i="4.000" if ; then echo "smaller" fi how do I convert the "4.000" to 4? Thanks! (4 Replies)
Discussion started by: h0ujun
4 Replies

9. Red Hat

How to check values stored in variable?

hey, i have stored values of query like this val_2=$( sqlplus -s rte/rted1@rel75d1 << EOF set heading off select source_id from cvt_istats where istat_id > $val_1; exit EOF ) echo $val_2 now , val_2 has five values displayed like this 1 2 3 4 5 what i have to do is to check the... (1 Reply)
Discussion started by: ramsavi
1 Replies

10. Shell Programming and Scripting

Need help on awk to compare only integer on particular column

Hi, 0.23 2.94% 0.00 0.00% 17.8G 55.7% 19.6G 40.9% 630 0.00% 0.06 0.77% - - 7524M 22.9% 15.6G 32.6% - - From the above sample output. I need to compare whether the 6th field is more than 10G..if so print the entire line. Here the 6th field is memory TIA (5 Replies)
Discussion started by: Sumanthsv
5 Replies
ldap_compare(3LDAP)					      LDAP Library Functions					       ldap_compare(3LDAP)

NAME
ldap_compare, ldap_compare_s, ldap_compare_ext, ldap_compare_ext_s - LDAP compare operation SYNOPSIS
cc[ flag... ] file... -lldap[ library... ] #include <lber.h> #include <ldap.h> int ldap_compare(LDAP *ld, char *dn, char *attr, char *value); int ldap_compare_s(LDAP *ld, char *dn, char *attr, char *value); int ldap_compare_ext(LDAP *ld, char *dn, char *attr, struct berval *bvalue, LDAPControl **serverctrls, LDAPControl **clientctrls, int *msgidp); int ldap_compare_ext_s(LDAP *ld, char *dn, char *attr, struct berval *bvalue, LDAPControl **serverctrls, LDAPControl **clientctrls); DESCRIPTION
The ldap_compare_s() function is used to perform an LDAP compare operation synchronously. It takes dn, the DN of the entry upon which to perform the compare, and attr and value, the attribute type and value to compare to those found in the entry. It returns an LDAP error code, which will be LDAP_COMPARE_TRUE if the entry contains the attribute value and LDAP_COMPARE_FALSE if it does not. Otherwise, some error code is returned. The ldap_compare() function is used to perform an LDAP compare operation asynchronously. It takes the same parameters as ldap_compare_s(), but returns the message id of the request it initiated. The result of the compare can be obtained by a subsequent call to ldap_result(3LDAP). The ldap_compare_ext() function initiates an asynchronous compare operation and returns LDAP_SUCCESS if the request was successfully sent to the server, or else it returns a LDAP error code if not (see ldap_error(3LDAP). If successful, ldap_compare_ext() places the message id of the request in *msgidp. A subsequent call to ldap_result(), can be used to obtain the result of the add request. The ldap_compare_ext_s() function initiates a synchronous compare operation and as such returns the result of the operation itself. ERRORS
ldap_compare_s() returns an LDAP error code which can be interpreted by calling one of ldap_perror(3LDAP) and friends. ldap_compare() returns -1 if something went wrong initiating the request. It returns the non-negative message id of the request if it was successful. ATTRIBUTES
See attributes(5) for a description of the following attributes: +-----------------------------+-----------------------------+ | ATTRIBUTE TYPE | ATTRIBUTE VALUE | |Availability |SUNWcsl (32-bit) | | |SUNWcslx (64-bit) | |Interface Stability |Evolving | +-----------------------------+-----------------------------+ SEE ALSO
ldap(3LDAP), ldap_error(3LDAP), attributes(5) BUGS
There is no way to compare binary values using ldap_compare(). SunOS 5.10 27 Jan 2002 ldap_compare(3LDAP)
All times are GMT -4. The time now is 02:08 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy