Sponsored Content
Full Discussion: atoi
Top Forums Programming atoi Post 101753 by matrixmadhan on Sunday 12th of March 2006 11:06:00 PM
Old 03-13-2006
Quote:
int i;
char str[20];
str="name";
i=atoi(str);
what is the purpose that is aimed for in converting a string literal "name" to an integer?
 

2 More Discussions You Might Find Interesting

1. Programming

help with atoi and macros in C

I have a PORT_NUM macro (10 digits long number) in a server file, if i do htons(PORT_NUM) i get warning: this decimal constant is unsigned only in ISO C90 warning: large integer implicitly truncated to unsigned type whats wrong with this? (2 Replies)
Discussion started by: omega666
2 Replies

2. Programming

type conversion C, atoi()

In the book "The C programming language"; second edition, chapter 2.7 there is a snippet which is supposed to: "convert a string of digits into its numeric equivalent". int atoi(char s) { int i, n; n = 0; for ( i = 0; s >= '0' && s <= '9'; ++i) n = 10 * n + (s -... (4 Replies)
Discussion started by: tornow
4 Replies
All times are GMT -4. The time now is 06:56 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy