Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > C Programming > Fixing cast from pointer to integer of different size

Reply
Thread Tools

Fixing cast from pointer to integer of different size

 
 
Arenlor
Guest
Posts: n/a
 
      07-30-2009
I'm wondering if there is a way to fix this, as no where online is
there anything about it. I have a char[] that I want to cast to an int.
 
Reply With Quote
 
 
 
 
nicolas.sitbon
Guest
Posts: n/a
 
      07-30-2009
On 30 juil, 10:22, Arenlor <(E-Mail Removed)> wrote:
> I'm wondering if there is a way to fix this, as no where online is
> there anything about it. I have a char[] that I want to cast to an int.


intptr_t or uintptr_t are preferred.
 
Reply With Quote
 
 
 
 
Arenlor
Guest
Posts: n/a
 
      07-30-2009
On Jul 30, 4:24*am, "nicolas.sitbon" <(E-Mail Removed)> wrote:
> On 30 juil, 10:22, Arenlor <(E-Mail Removed)> wrote:
>
> > I'm wondering if there is a way to fix this, as no where online is
> > there anything about it. I have a char[] that I want to cast to an int.

>
> intptr_t or uintptr_t are preferred.


Cool, fixed it, didn't realize I'd have to include a whole new
library, but it works.
 
Reply With Quote
 
Chris Dollin
Guest
Posts: n/a
 
      07-30-2009
Arenlor wrote:

> I'm wondering if there is a way to fix this, as no where online is
> there anything about it. I have a char[] that I want to cast to an int.


/Why/ do you want to cast a char[] (more likely, a char*) to an int?

Perhaps there's a better answer to the bigger problem.

--
"It is seldom good news." ~Crystal Ball~, /The Tough Guide to Fantasyland/

Hewlett-Packard Limited Cain Road, Bracknell, registered no:
registered office: Berks RG12 1HN 690597 England

 
Reply With Quote
 
RjY
Guest
Posts: n/a
 
      07-30-2009
Arenlor posted:
>I'm wondering if there is a way to fix this, as no where online is
>there anything about it. I have a char[] that I want to cast to an int.


Try intptr_t, from stdint.h, instead of int.

--
http://rjy.org.uk/
 
Reply With Quote
 
Keith Thompson
Guest
Posts: n/a
 
      07-30-2009
Arenlor <(E-Mail Removed)> writes:
> I'm wondering if there is a way to fix this, as no where online is
> there anything about it. I have a char[] that I want to cast to an int.


What are you trying to accomplish?

You have some problem that you're not telling us about. Casting a
pointer to an integer is a solution to that problem, not a goal in
itself -- and it may be the wrong solution.

--
Keith Thompson (The_Other_Keith) http://www.velocityreviews.com/forums/(E-Mail Removed) <http://www.ghoti.net/~kst>
Nokia
"We must do something. This is something. Therefore, we must do this."
-- Antony Jay and Jonathan Lynn, "Yes Minister"
 
Reply With Quote
 
 
 
Reply

Thread Tools

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 Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Help: "Assignment makes integer from pointer without a cast" Juggernaut C Programming 10 04-09-2005 08:00 AM
warning: passing arg 1 of `atoi' makes pointer from integer without a cast francescomoi@europe.com C Programming 2 04-01-2005 05:30 PM
warning: assignment makes integer from pointer without a cast Dawn Minnis C Programming 4 02-20-2005 07:02 PM
fmemopen: assignment makes pointer from integer without a cast Markus Dehmann C Programming 14 06-28-2004 01:12 PM
assignment makes pointer from integer without a cast...help please. Rocke Robertson C Programming 14 10-02-2003 01:35 PM



Advertisments