The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

Go Back   The UNIX and Linux Forums > Top Forums > High Level Programming
.
google unix.com



High Level Programming Post questions about C, C++, Java, SQL, and other programming languages here.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Converting integer to String ROOZ Shell Programming and Scripting 1 06-05-2008 01:38 PM
Function to return an array of integer dwgi32 High Level Programming 2 11-20-2007 02:08 AM
conersting string to integer abb058 UNIX for Dummies Questions & Answers 2 08-23-2006 07:52 AM
Integer to String psilva High Level Programming 2 08-17-2001 12:14 PM
convert from an integer to a string mojomonkeyhelper UNIX for Dummies Questions & Answers 6 03-29-2001 04:15 PM

Closed Thread
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Bulgarian Greek Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 03-06-2005
qqq qqq is offline
Registered User
  
 

Join Date: Feb 2005
Posts: 11
C function to test string or integer

Hi everyone ,
Is there any predefined C function that tests whether an input is string or an integer?
Thank's in advance
  #2 (permalink)  
Old 03-06-2005
Perderabo's Avatar
Perderabo Perderabo is offline Forum Staff  
Unix Daemon
  
 

Join Date: Aug 2001
Location: Ashburn, Virginia
Posts: 9,119
You can use strtol to convert the string to an integer. strtol can report on the first invalid character. No invalid characters means the entire string was an integer.
  #3 (permalink)  
Old 03-06-2005
qqq qqq is offline
Registered User
  
 

Join Date: Feb 2005
Posts: 11
I have tried it and it works. Thank's Perderabo!!
  #4 (permalink)  
Old 03-10-2005
sivaji9 sivaji9 is offline
Registered User
  
 

Join Date: Jan 2005
Posts: 1
Angry sivaji

I have tried it and it works. Thank's Perderabo!!
Closed Thread

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -4. The time now is 05:00 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0