Login
User Name:

Password:



Register
Forgot your password?
Vote for Us!
tintin++ ogg sound player script for linux
Author: Robert Smith
Submitted by: Vladaar
6Dragons ogg Soundpack
Author: Vladaar
Submitted by: Vladaar
6Dragons 4.4
Author: Vladaar
Submitted by: Vladaar
LoP 1.46
Author: Remcon
Submitted by: Remcon
LOP 1.45
Author: Remcon
Submitted by: Remcon
Users Online
CommonCrawl, Yandex

Members: 0
Guests: 9
Stats
Files
Topics
Posts
Members
Newest Member
481
3,734
19,366
618
Micheal64X
Today's Birthdays
There are no member birthdays today.
Related Links
» SmaugMuds.org » General » Coding » itoa
Forum Rules | Mark all | Recent Posts

itoa
< Newer Topic :: Older Topic > seems silly to me...

Pages:<< prev 1 next >>
Post is unread #1 Feb 5, 2004, 5:51 pm   Last edited Nov 24, 2007, 3:14 pm by Samson
Go to the top of the page
Go to the bottom of the page

cynshard

GroupMembers
Posts95
JoinedNov 19, 2003

I'm writing a little procedure that will allow gods to go to a zone by typing gozone . I am checking the argument against all the current areas (A LA Foldarea). if the argument matches an area name i then call do_goto and send the char to the low_vnum of that area. In order to do this though, low_vnum needs to be a string to work with do_goto. At first I thought I'd just do this
do_goto( ch, buf = itoa(argument, buf, 10) ). I received the classic "function undefined error". I thought that was strange since other procedures in build.c use atoi, so i incluede stdlib.h and I'm getting the same error. Maybe I'm missing some cygwin packages, although I'm pretty sure I grabbed them all. I'm sitting at work so I can't try this just yet, I think I'll try this:
char *buf;
sprintf(buf, "%d", tarea->low_vnum);
do_goto(ch,buf);

I'm not too sure on the syntax of the sprintf function, but I don't see why that wouldn't work.
Ok, I'm done thinking out loud.
       
Post is unread #2 Feb 5, 2004, 7:37 pm
Go to the top of the page
Go to the bottom of the page

Samson
Black Hand
GroupAdministrators
Posts3,643
JoinedJan 1, 2002

First off, there is no itoa in the standard libraries. Yes, it seems illogical to me as well, but hey. I didn't write the things

As for why your solution failed, you need to change char *buf; to this:

char buf[MAX_INPUT_LENGTH];
       
Pages:<< prev 1 next >>