Skip to Main Content

DevOps, CI/CD and Automation

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Using snprintf() without -std=c++11, how?

RaiderOfTheLostSPARCAug 13 2015 — edited Aug 21 2015

Hi,

is there a way to use snprintf() without -std=c++11?

$ CC -g -std=c++11 snprintf.cc                               

$ CC -g snprintf.cc                                          

"snprintf.cc", line 7: Error: snprintf is not a member of std.

1 Error(s) detected.

$ cat snprintf.cc                                            

#include <cstdio>

int

main(void)

{

  char buffer[100];

  int ret = std::snprintf(buffer, 100, "The half of %d is %d", 60, 60/2);

  return 0;

}

This post has been answered by Steve.Clamage-Oracle on Aug 21 2015
Jump to Answer
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Sep 18 2015
Added on Aug 13 2015
1 comment
2,034 views