Setting string size via function parameter
#8

Quote:
Originally Posted by Ada32
Посмотреть сообщение
I won't argue with you, you don't even show me what I did wrong in there, there's alot of different style creating a macro, I apologize for being unprofessional *(Above, because your comment made me lol)

Pawn code
pawn Код:
#include <a_samp>

#define Create.%0(%1) \
    new %0[%1]
   
main()
{
    Create.string(128);
   
    new pds2k12 = 60 * 10 / 5;
    format(string, sizeof(string), "60 x 10 ч 5 = %i", pds2k12);
    print(string);
}
Result
pawn Код:
60 x 10 ч 5 = 120
Try the code here: http://slice-vps.nl:7070/

EDIT: lets go hard if you don't believe.

Pawn Code
pawn Код:
#include <a_samp>

#define Create.%0(%1) \
    new %0[%1]
   
main()
{
    new StartTick = GetTickCount();
    Create.string(128);
    printf("Took %i ms to create a string", GetTickCount() - StartTick);
   
    new StartTick1 = GetTickCount();
    new pds2k12 = 60 * 10 / 5;
    format(string, sizeof(string), "60 x 10 ч 5 = %i", pds2k12);
    print(string);
    printf("Took %i ms to execute the string & variable", GetTickCount() - StartTick1);
}
Result
Код:
Took 0 ms to create a string
60 x 10 ч 5 = 120
Took 1 ms to execute the string & variable
Reply


Messages In This Thread
Setting string size via function parameter - by GiS - 30.12.2013, 12:58
Re : Setting string size via function parameter - by [HRD]Mar1 - 30.12.2013, 13:02
Re: Setting string size via function parameter - by Patrick - 30.12.2013, 13:12
Re: Setting string size via function parameter - by Ada32 - 30.12.2013, 13:15
Re: Setting string size via function parameter - by Patrick - 30.12.2013, 13:16
Re: Setting string size via function parameter - by Ada32 - 30.12.2013, 13:20
AW: Setting string size via function parameter - by GiS - 30.12.2013, 13:21
Re: Setting string size via function parameter - by Patrick - 30.12.2013, 13:29
AW: Setting string size via function parameter - by GiS - 30.12.2013, 13:48
Re: Setting string size via function parameter - by PowerPC603 - 30.12.2013, 15:06

Forum Jump:


Users browsing this thread: 1 Guest(s)