Skip to main content
Second iteration. Removed unnecessary formatting.
Source Link
Peter Mortensen
  • 31.4k
  • 22
  • 110
  • 134

I have a large array in CC (not C++C++ if that makes a difference). I want to initialize all members of the same value.

I could swear I once knew a simple way to do this. I could use memset() in my case, but isn't there a way to do this that is built right into the C syntax?

I have a large array in C (not C++ if that makes a difference). I want to initialize all members of the same value.

I could swear I once knew a simple way to do this. I could use memset() in my case, but isn't there a way to do this that is built right into the C syntax?

I have a large array in C (not C++ if that makes a difference). I want to initialize all members of the same value.

I could swear I once knew a simple way to do this. I could use memset() in my case, but isn't there a way to do this that is built right into the C syntax?

Fixed the question formation - missing auxiliary (or helping) verb - see e.g. <https://www.youtube.com/watch?v=t4yWEt0OSpg&t=1m49s> (see also <https://www.youtube.com/watch?v=kS5NfSzXfrI> (QUASM)) - alternatively, drop the question mark.
Link
Peter Mortensen
  • 31.4k
  • 22
  • 110
  • 134

How tocan I initialize all members of an array to the same value?

added 11 characters in body
Source Link

I have a large array in CC (not C++C++ if that makes a difference). I want to initialize all members toof the same value. 

I could swear I once knew a simple way to do this. I could use memset() in my case, but isn't there a way to do this that is built right into the C syntax?

I have a large array in C (not C++ if that makes a difference). I want to initialize all members to the same value. I could swear I once knew a simple way to do this. I could use memset() in my case, but isn't there a way to do this that is built right into the C syntax?

I have a large array in C (not C++ if that makes a difference). I want to initialize all members of the same value. 

I could swear I once knew a simple way to do this. I could use memset() in my case, but isn't there a way to do this that is built right into the C syntax?

edited title
Link
Lundin
  • 220k
  • 47
  • 281
  • 446
Loading
title matches question
Link
M.M
  • 142.7k
  • 26
  • 223
  • 400
Loading
Question Protected by chown
added 12 characters in body; edited tags; edited title
Source Link
Peter Mortensen
  • 31.4k
  • 22
  • 110
  • 134
Loading
Source Link
Matt
  • 88.7k
  • 25
  • 65
  • 67
Loading