Page 1 of 1

Contents of Sprintf?

PostPosted: Thu Sep 10, 2009 11:59 pm
by Hblade
Hey guys, We all know what sprintf does, and uh... well, I jsut want to know. HOW THE HECK does it let you ADD more to it? for example, here's one sprintf
sprintf(text, "Hi"); and here's another one
sprintf(text, Hi, my name is %d", name); O.o



Anyone have any idea how you can make a void that will allow you to add like that? I'm trying to make a function that allows you to have selections (Its for my new window creation method for creating PERFECT windows that will apear seamlesss and let you have selections in them)

For example...
CreateWindowSelections("window name", selection_ammount, "Type selections here", "Type Selections here"); See what I mean? :D

Re: Contents of Sprintf?

PostPosted: Fri Sep 11, 2009 2:28 am
by pyrometal
It seems GE is not capable of this since it lacks the ability to add headers... In C, you would include "stdarg.h" which contains the mechanisms to allow you to filter arbitray amounts of arguments passed to a function.

Well... GE allows you to pass undertermined amounts of arguments like you would expect actual C code to by doing this:

Code: Select all
myFunction(int arg1, ...)
{
    //code here
}


so "myFunction" can now be passed any amounts of arguments, but since you need "stdarg.h" and its special data types and functions to read and use these arguments, you cannot use them in any way... This is something that should be added sometime in GE's future hopfully. (unless it already exists in GE but haven't heard about how it is to be used...)

Anyway, hope I'm not breaking your bubble too much, ttyl Hblade!

Re: Contents of Sprintf?

PostPosted: Fri Sep 11, 2009 2:58 am
by Hblade
Thanks for the response, i'm going to have to find another way to do this.