Jump to content
    

Почему не передаются аргументы в PRINTF?

Хотел сделать такое:

int MY_printf(const char *format, ...)
{
	va_list args;
	va_start(args, format);
	vprintf(format, args);
	va_end(args);
}

int main (void)
{    
 	MY_printf("GHF %f %f\r\n", 12, 14);
}

Вообще такое возможно?

Share this post


Link to post
Share on other sites

Ага, обнаружил что проблема только с флоатом. %f не прокатывает. %d прокатывает исправно.

1 minute ago, GenaSPB said:
MY_printf("GHF %f %f\r\n", (float) 12, (float) 14);

Спасибо! Теперь прокатывает и с флоатом.

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...