Sponsored Content
Top Forums Programming How to find length of string and pass into char array in C? Post 302525750 by atharalikhan on Saturday 28th of May 2011 03:36:44 AM
Old 05-28-2011
How to find length of string and pass into char array in C?

Hi All
I want to take a Hexadecimal number as input and i want to find lenth of the input and pass it to char s[] ( char s[length of the input] ). I have a program to convert hexadecial to binary but it is taking limited input but i want to return binary number based on input. How?
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

string of 7 char length always...

Hi, I know, particular value in the variable should always be of lenth 7 , but the value that is present in thevariable might be of any no.of characters less than or equal to 7... if the no.of characters in the variable is less than 7, I want to add, zeroes at the starting of the field.. How can... (3 Replies)
Discussion started by: thanuman
3 Replies

2. Programming

md5 hash a string or char array in SCO

Can someone provide me with code to md5 hash a string or character array in the SCO environment. All help is appreciated thanks. (5 Replies)
Discussion started by: jcarter2333
5 Replies

3. Shell Programming and Scripting

find the string length in solaris

how to find the string length in solaris machine. (4 Replies)
Discussion started by: din_annauniv
4 Replies

4. UNIX for Dummies Questions & Answers

Read a string with leading spaces and find the length of the string

HI In my script, i am reading the input from the user and want to find the length of the string. The input may contain leading spaces. Right now, when leading spaces are there, they are not counted. Kindly help me My script is like below. I am using the ksh. #!/usr/bin/ksh echo... (2 Replies)
Discussion started by: dayamatrix
2 Replies

5. Programming

pass char string via system()

hello all i am trying to pass a argument through system function to a shell script. #shell script echo.sh to display the string echo $1 and the c program is. #include<stdlib.h> int main() { const char *str = "hello all"; system("sh echo.sh str"); } the output i... (5 Replies)
Discussion started by: zius_oram
5 Replies

6. Shell Programming and Scripting

Replacing one Char in a string of variable length

Hi all, I am trying to find the best way of making a change to 1 char in a string, the string can be between 1 and 14 characters. I am reading a line in from a file which contains 012341231231:2:102939283:NNN: Require :NBN: 012838238232:3:372932:NNN: Require :NNB: I need to change 1 N or a... (8 Replies)
Discussion started by: nkwilliams
8 Replies

7. Shell Programming and Scripting

Longest length of string in array

I would be grateful if someone could help me. I am trying to write a .sh script in UNIX. I have the following code; User=john User=james User=ian User=martin for x in ${User} do print ${#x} done This produces the following output; 4 5 3 6 (12 Replies)
Discussion started by: mmab
12 Replies

8. Programming

Fastest way to find the length of string in c

Hi all, We use strlen() fun provided by library to find the length of a string. Looking inside of it, it has some different mechanism to find the length of string. Normally, we scan the string byte by byte until the '\0' character. It takes a logn time to count length. The Library strlen()... (2 Replies)
Discussion started by: yogeshrl9072
2 Replies

9. Shell Programming and Scripting

How to find length of multidimension array ???

Does anyone know how to find length of multi dimension array of following type A Afor simple array I is to do for (i in A)n++ to find length of array but if it is multi dimension how to find the length ? (2 Replies)
Discussion started by: nex_asp
2 Replies

10. UNIX for Beginners Questions & Answers

Views How to replace a CRLF char from a variable length file in the middle of a string in UNIX?

My sample file is variable length, with out any field delimiters. It has min of 18 chars length and the 'CRLF' is potentially between 12-14 chars. How do I replace this with a space? I still want to keep end of record, but just want to remove these new lines chars in the middle of the data. ... (7 Replies)
Discussion started by: chandrath
7 Replies
CATOD(1)						      General Commands Manual							  CATOD(1)

NAME
catod - To convert the text format of a dictionary to binary format. SYNOPSIS
catod [-s maxword ] [-R] [-r] [-e] [-S] [-U] [-P dicpasswd ] [-p frepasswd ] [-h cixingfile ] outfilename DEFAULT PATH
/usr/local/bin/cWnn4/catod DESCRIPTION
This command converts a dictionary from text format into binary format. outfilename is the name of the binary format dictionary. If outfilename is not given, the output will be passed to the standard output device(stdout). The input file may be piped in by using the "<" command. For example, catod basic.dic < basic.u "basic.dic" here is the output binary format dictionary, while the "basic.u" is the input text format dictionary. If the input text dictionary is not given, the input will be taken from the standard input(stdin). To end the input via standard input, press ^D. OPTIONS
-s maxword To specify the maximum number of words. Default is 70000. -R To create a dictionary for both forward and reverse conversion. (Default). -r To create a reverse format dictionary only for reverse conversion. -e If the Hanzi inside the text dictionary contains characters such as space and tab, they will be compacted to special format. (Default). -S To create a static dictionary. -U To create a dynamic dictionary. -P dicpasswd To specify the password for the dictionary. If "-N" is used instead, the password of the dictionary will be set to "*". -p frepasswd To specify the password for the usage frequency file. If "-n" is used instead, the password of the frequency file will be set to "*". -h cixingfile To specify the Cixing definition file. NOTE
1. The parts in [ ] are options. They may be omitted. 2. The Pinyin and Zhuyin dictionary has the same format. 3. For details of the dictionary structure, refer to cWnn manual. 13 May 1992 CATOD(1)
All times are GMT -4. The time now is 07:32 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy