Sponsored Content
Top Forums Programming Search attributes in one structure using the values from another structure Post 302178858 by dhanamurthy on Wednesday 26th of March 2008 12:51:59 PM
Old 03-26-2008
Search attributes in one structure using the values from another structure

Hello Groups

I am trying to find out ways of comparing a value from a 'c' structure to a value in another 'C' structure. the 'C' structure can be a List or liked list as it contains lot many records.

if we loop it in both the structures it is going to consume time.
I am looking for a simple algorithm where i can implement it easily.

For eg)

struct x
{
char empname[20] ;
int empno;
int deptno;
}x1;

struct y
{
char deptname[20];
int deptno;

}y1;

Structure x can be in a list where it contains say 1000 records and similaraly y.
I need to search the deptno of x in deptno of y.

Reply me if you have ideas.


Regards
Dhanamurthy
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

if then else structure

echo name the file that you want to read read answer if then echo you must enter a file name fi cat $answer im trying to catch the error if user forget to enter the name of the file anyone can help me ? thanks:confused: (4 Replies)
Discussion started by: props
4 Replies

2. UNIX for Dummies Questions & Answers

Copying a Directory Structure to a new structure

Hi all Is it possible to copy a structure of a directory only. e.g. I have a file with the following entries that is a result of a find :- /dir1/dir2/file.dbf /dir1/dir2/dir3/file1.dbf /dir1/file.dbf I want to copy these to a directory and keep the structure however starting at a new dir... (8 Replies)
Discussion started by: jhansrod
8 Replies

3. UNIX for Advanced & Expert Users

MV files from one directory structure(multiple level) to other directory structure

Hi, I am trying to write a script that will move all the files from source directory structure(multiple levels might exist) to destination directory structure. If a sub folder is source doesnot exist in destination then I have to skip and goto next level. I also need to delete the files in... (4 Replies)
Discussion started by: srmadab
4 Replies

4. UNIX for Dummies Questions & Answers

Size of Structure

How can we find size of a structure with out using sizeof operator? Thanks, Harika (2 Replies)
Discussion started by: harikamamidala
2 Replies

5. UNIX for Dummies Questions & Answers

Directory Structure

Hi... I have a directory which has multiple directories and sub directories inside... what command should i use to get a list of all these directories, without the filenames.... (2 Replies)
Discussion started by: saharookiedba
2 Replies

6. Shell Programming and Scripting

Perl Data Structure - Non unique values

I have the perl data structure and what i need to do is find all values in @{$extractColumns{'2'}{'D'}} which are not there in @{$extractColumns{'2'}{'M'}} but seems like i need to put a flag somewhere and i messed up foreach my $order (keys %extractColumns) { foreach my $value... (2 Replies)
Discussion started by: dinjo_jo
2 Replies

7. Shell Programming and Scripting

Script to search specific folders dates /mm/dd/ structure

Hi, I have a script that handles a huge amount of log files from many machines and copies it into a SAN location with the following directory structure: /SAN/machinenames/yyyy/m/d so for example /SAN/hosta/2011/3/12/files* Now I am writing a bash script to search for files between to date... (4 Replies)
Discussion started by: GermanJulian
4 Replies

8. Shell Programming and Scripting

Wget structure

Im reading a lot about wget and have really enjoyed using it. However I see a lot of tutorials that will show several ways. I want to be able to write scripts in gedit so I was wondering what is the best process to do this instead of just running them in the terminal?? (3 Replies)
Discussion started by: graphicsman
3 Replies

9. Shell Programming and Scripting

Running a program multiple times to search pattern and assign structure

Hi all, I have a big file (n.txt) with following pattern: ATOM 1 N SER A 1 122.392 152.261 138.190 1.00 0.00 N ATOM 2 CA SER A 1 122.726 151.241 139.183 1.00 0.00 C TER ENDMDL ATOM 1 N SER A 1 114.207 142.287 135.439 1.00 0.00 ... (3 Replies)
Discussion started by: bioinfo
3 Replies

10. Programming

Sctp api name to retrieve the values of structure sctpassoctable

Hi i want a sctp (lksctp) api which can retrieve the values of the sctp structure "sctpAssocTable" It is sctpassoctable or sctpassocentry. SctpAssocEntry ::= SEQUENCE { sctpAssocId Unsigned32, sctpAssocRemHostName OCTET STRING, sctpAssocLocalPort ... (1 Reply)
Discussion started by: harioum
1 Replies
ARES_PARSE_A_REPLY(3)					     Library Functions Manual					     ARES_PARSE_A_REPLY(3)

NAME
ares_parse_a_reply - Parse a reply to a DNS query of type A SYNOPSIS
#include <ares.h> int ares_parse_a_reply(const unsigned char *abuf, int alen, struct hostent **host, struct ares_addrttl *addrttls, int *naddrttls); DESCRIPTION
The ares_parse_a_reply function parses the response to a query of type A into a struct hostent and/or an array of struct ares_addrttls. The parameters abuf and alen give the contents of the response. The result is stored in allocated memory and a pointer to it stored into the variable pointed to by host, if host is nonnull. It is the caller's responsibility to free the resulting host structure using ares_free_hostent(3) when it is no longer needed. If addrttls and naddrttls are both nonnull, then up to *naddrttls struct ares_addrttl records are stored in the array pointed to by addrt- tls, and then *naddrttls is set to the number of records so stored. Note that the memory for these records is supplied by the caller. RETURN VALUES
ares_parse_a_reply can return any of the following values: ARES_SUCCESS The response was successfully parsed. ARES_EBADRESP The response was malformatted. ARES_ENODATA The response did not contain an answer to the query. ARES_ENOMEM Memory was exhausted. SEE ALSO
ares_gethostbyname(3), ares_free_hostent(3) AUTHOR
Greg Hudson, MIT Information Systems Copyright 1998 by the Massachusetts Institute of Technology. 25 July 1998 ARES_PARSE_A_REPLY(3)
All times are GMT -4. The time now is 01:26 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy