KnowledgeHub
Questions
Tags
Users
Search
Alex Rivera
|
Logout
Edit Question
Title
Body
First, I'd like to say that I'm new to C / C++, I'm originally a PHP developer so I am bred to abuse variables any way I like 'em. C is a strict country, compilers don't like me here very much, I am used to breaking the rules to get things done. Anyway, this is my simple piece of code: char IP[15] = "192.168.2.1"; char separator[2] = "||"; puts( separator ); Output: ||192.168.2.1 But if I change the definition of separator to: char separator[3] = "||"; I get the desired output: || So why did I need to give the man extra space, so he doesn't sleep with the man before him?
Tags (comma-separated)
Save Edits
Cancel