[riot-devel] char* to int and vice versa

Kees Bakker kees at sodaq.com
Tue Sep 6 22:01:02 CEST 2016


(( Meanwhile the original question was clarified. ))

Still I wanted to say that, in C99 there are specific types to convert a 
pointer to an integer type.
Don't just cast a pointer to an int or a long. It is not portable.


On 05-09-16 18:10, Simon Brummer wrote:
>
> Well, in c any Pointer is an integer. If you want the plain numeric 
> value, you can just cast the pointer to int. There is no conversion 
> function
>
>
> Am 05.09.2016 5:58 nachm. schrieb "Adeel Mohammad Malik" 
> <adeel.mohammad.malik at ericsson.com 
> <mailto:adeel.mohammad.malik at ericsson.com>>:
>
>     Hi,
>
>     A quick question, what functions should I use to convert between a
>     char * and int in RIOT?
>
>     /Adeel
>
>
>     _______________________________________________
>     devel mailing list
>     devel at riot-os.org <mailto:devel at riot-os.org>
>     https://lists.riot-os.org/mailman/listinfo/devel
>     <https://lists.riot-os.org/mailman/listinfo/devel>
>
>
>
>
> _______________________________________________
> devel mailing list
> devel at riot-os.org
> https://lists.riot-os.org/mailman/listinfo/devel


-- 
Kees Bakker
Founder
SODAQ
M. 0031617737165
www.sodaq.com

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.riot-os.org/pipermail/devel/attachments/20160906/bfe51448/attachment-0001.html>


More information about the devel mailing list