Sponsored Content
Top Forums Programming messy questions: how to convert a string into a int64 in linux Post 302381432 by jim mcnamara on Friday 18th of December 2009 06:41:26 AM
Old 12-18-2009
Try strtoimax() if int64 is the same as intmax_t on your system.
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Is there a place like this for LINUX questions?

Is there some place like this unix.com for linux questions? a forum like area to ask questions? I love this site, i've learned a lot (use unix - solaris, and linux - redhat). Unfortunately redhat.com has gotten rid of their support forums, everything is in a list type format and I don't want to... (6 Replies)
Discussion started by: kymberm
6 Replies

2. Linux

Linux questions

Hi everyone, I came from a diffrent UNIX background and am trying to learn Linux (Red Hat) in a hurry. I would be very grateful if you could help me with the following questions. I know the answers for questions 1, 3, and 4 in a Sun Solaris environment, but not in Linux... Thanks in advance for... (3 Replies)
Discussion started by: Enigma777
3 Replies

3. Programming

char to int64 conversion

Hi, I'm converting a C program that I made using the Visual Studio. I now use GCC (over Linux) and can't find some equivalences. I changed my __int64 definitions to unsigned long long, but can't find an equivalent to the microsoft i64toa() function, which let you convert a char* to a 64 bit... (1 Reply)
Discussion started by: Raspoutine
1 Replies

4. Shell Programming and Scripting

PCRE string questions.

What is the string that would satisfy this expression: "^gs{3}$" ? What is an expression that would satisfy all these strings: csafaq.exe, csafbc.exe, asdfcd.exe? Also, To catch these files, : gdnus1862.exe gdnus10.exe gdnus250.exe gdnus2337.exe I am using this regex. :... (2 Replies)
Discussion started by: komputersman
2 Replies

5. Shell Programming and Scripting

Getting multiple messy lines into one single line

I have a file that contains the following: :@:176:@:4:@:name:@:file:@:this is a summary:@:description can be long but who knows can even have <br> tags.:@:how to:@:type:@:18544:@:550:@:400:END: :@:177:@:9:@:name:@:file:@:summary:@:this will containg... (18 Replies)
Discussion started by: sysrenan
18 Replies

6. Programming

How to use we use int64?

Recently my project needs int64 variables. However my os and computer are both 32bits. So how can i use int64 as a parameter in a function. and is int64 a structure as user-defined structures..... ??? thanx i am waiting for ur answer:rolleyes: (2 Replies)
Discussion started by: macroideal
2 Replies

7. Shell Programming and Scripting

Help with convert string

Hi. I will be very appreciated for help. I need replace all characters into string with \ (backslash) I mean if I have word abcdefg as input. How I can convert it to \a\b\c\d\e\f\g Thanks and best regards. Staas. (5 Replies)
Discussion started by: beckss
5 Replies

8. Shell Programming and Scripting

Search several string and convert into a single line for each search string using awk command AIX?.

I need to search the file using strings "Request Type" , " Request Method" , "Response Type" and by using result set find the xml tags and convert into a single line?. below are the scenarios. Cat test Nov 10, 2012 5:17:53 AM INFO: Request Type Line 1.... (5 Replies)
Discussion started by: laknar
5 Replies

9. UNIX for Advanced & Expert Users

Transpose Messy Data

I have a messy, pipe-delimited ("|") input dataset. I would like to create a file of ID plus each component of field 4 which is delimited by ";" into a long, skinny shape for easier processing. A couple of complications are that field 4 may contain both commas and linefeed characters from the... (9 Replies)
Discussion started by: 91674io
9 Replies

10. Shell Programming and Scripting

Perl:: Arrays w/ UInt64.max>index>Int64

Where is the delete or remove post option? (1 Reply)
Discussion started by: f77hack
1 Replies
STRTOL(3)						   BSD Library Functions Manual 						 STRTOL(3)

NAME
strtol, strtoll, strtoimax, strtoq -- convert a string value to a long, long long, intmax_t or quad_t integer LIBRARY
Standard C Library (libc, -lc) SYNOPSIS
#include <stdlib.h> #include <limits.h> long strtol(const char * restrict nptr, char ** restrict endptr, int base); long long strtoll(const char * restrict nptr, char ** restrict endptr, int base); #include <inttypes.h> intmax_t strtoimax(const char * restrict nptr, char ** restrict endptr, int base); #include <sys/types.h> #include <stdlib.h> #include <limits.h> quad_t strtoq(const char *nptr, char **endptr, int base); DESCRIPTION
The strtol() function converts the string in nptr to a long value. The strtoll() function converts the string in nptr to a long long value. The strtoimax() function converts the string in nptr to an intmax_t value. The strtoq() function converts the string in nptr to a quad_t value. The conversion is done according to the given base, which must be between 2 and 36 inclusive, or be the special value 0. The string may begin with an arbitrary amount of white space (as determined by isspace(3)) followed by a single optional '+' or '-' sign. If base is zero or 16, the string may then include a ``0x'' prefix, and the number will be read in base 16; otherwise, a zero base is taken as 10 (decimal) unless the next character is '0', in which case it is taken as 8 (octal). The remainder of the string is converted to a long, long long, intmax_t or quad_t value in the obvious manner, stopping at the first charac- ter which is not a valid digit in the given base. (In bases above 10, the letter 'A' in either upper or lower case represents 10, 'B' repre- sents 11, and so forth, with 'Z' representing 35.) If endptr is not NULL, strtol() stores the address of the first invalid character in *endptr. If there were no digits at all, however, strtol() stores the original value of nptr in *endptr. (Thus, if *nptr is not '' but **endptr is '' on return, the entire string was valid.) RETURN VALUES
The strtol(), strtoll(), strtoimax() and strtoq() functions return the result of the conversion, unless the value would underflow or over- flow. If no conversion could be performed, 0 is returned and the global variable errno is set to EINVAL (the last feature is not portable across all platforms). If an overflow or underflow occurs, errno is set to ERANGE and the function return value is clamped according to the following table. Function underflow overflow strtol() LONG_MIN LONG_MAX strtoll() LLONG_MIN LLONG_MAX strtoimax() INTMAX_MIN INTMAX_MAX strtoq() LLONG_MIN LLONG_MAX ERRORS
[EINVAL] The value of base is not supported or no conversion could be performed (the last feature is not portable across all plat- forms). [ERANGE] The given string was out of range; the value converted has been clamped. SEE ALSO
atof(3), atoi(3), atol(3), strtod(3), strtonum(3), strtoul(3), wcstol(3) STANDARDS
The strtol() function conforms to ISO/IEC 9899:1990 (``ISO C90''). The strtoll() and strtoimax() functions conform to ISO/IEC 9899:1999 (``ISO C99''). The BSD strtoq() function is deprecated. BSD
November 28, 2001 BSD
All times are GMT -4. The time now is 01:17 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy