[gentoo-user] OT: shouldn't this work?

2003-06-24 Thread Christopher Egner
#include 
#include 

int main () {
char b[] = "300";

long a;
char *c;
c = b;
c++;
printf("String being used as tail: %s\n", c);
a = strtol(b, &c, 16);

printf("\nDigit: %d\nChar: %c\n", a, a);
return 0;
}



--
[EMAIL PROTECTED] mailing list



Re: [gentoo-user] OT: shouldn't this work?

2003-06-24 Thread Christopher Egner
Okay I caught my error. However, I'm still trying to come up with a way
to do this. I basically need to pluck it out from the middle of the
string. But I can't be gaurenteed the next value after the two I need
are going to be non-asii. I could just copy the two chars to a buff to
do my work, but i'd rather not, if possible.
On Tue, 2003-06-24 at 21:38, Christopher Egner wrote:
> #include 
> #include 
> 
> int main () {
> char b[] = "300";
> 
> long a;
> char *c;
> c = b;
> c++;
> printf("String being used as tail: %s\n", c);
> a = strtol(b, &c, 16);
> 
> printf("\nDigit: %d\nChar: %c\n", a, a);
> return 0;
> }
> 
> 
> 
> --
> [EMAIL PROTECTED] mailing list
> 


--
[EMAIL PROTECTED] mailing list