Find the answer to your Linux question:
Results 1 to 2 of 2
is there anyway to cast a 'char' type into a 'int' type in the Kernel? like 'atoi'.... Thank you....
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    cfh
    cfh is offline
    Just Joined!
    Join Date
    Sep 2005
    Posts
    11

    type cast in Kernel


    is there anyway to cast a 'char' type into a 'int' type in the Kernel?
    like 'atoi'....

    Thank you.

  2. #2
    Linux Guru lakerdonald's Avatar
    Join Date
    Jun 2004
    Location
    St. Petersburg, FL
    Posts
    5,035
    Well since a char really is a very small int, you can get the numeric value of it by just using it like an int, or just casting it
    Code:
    (int) foo
    .

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •