© 2026 Hedgehog Software, LLC
Twitter
GitHub
Discord
System
Light
Dark
More
Communities
Docs
About
Terms
Privacy
Search
Star
Feedback
Setup for Free
C
C#
•
13mo ago
•
36 replies
Faker
✅ Declaring and initializing multiple values in a single line in C#
Hello guys
, consider the following statement
:
int monsterHealth, heroHealth = 0;
int monsterHealth, heroHealth = 0;
If I write this code
, heroHealth is assigned to 0
, will this also assign monsterHealth to 0
?
C#
Join
We are a programming server aimed at coders discussing everything related to C# (CSharp) and .NET.
61,871
Members
View on Discord
Resources
ModelContextProtocol
ModelContextProtocol
MCP Server
Recent Announcements
Similar Threads
Was this page helpful?
Yes
No
Similar Threads
C++ struct initializing in C#
C
C# / help
3y ago
❔ Adding list in single line
C
C# / help
3y ago
{} vs [] when initializing an array in C#
C
C# / help
13mo ago
✅ NullReferenceException when declaring an array but not initializing it
C
C# / help
13mo ago