Intel® C++ Compiler
Community support and assistance for creating C++ code that runs on platforms based on Intel® processors.
Announcements
The Intel sign-in experience has changed to support enhanced security controls. If you sign in, click here for more information.
7783 Discussions

auto size_t array initialization

ozarbit
Beginner
169 Views
Hi,

[cpp]void f()
{
  size_t keys[32];
  for (size_t s=0; s<32; ++s)
  {
     keys  = s;
  }[/cpp]
Is this the fastest way to initialize the small keys arrays to hold consecutive size_t values?
regards,
0 Kudos
1 Reply
jimdempseyatthecove
Black Belt
169 Views

[cpp]void f()
{
  size_t keys[32] = { 0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,21,23,24,25,26,27,28,29,30,31};



should be faster
Jim Dempsey












[/cpp]
Reply