Arrays in C: Declare, Initialize, Loop and Pass Arrays to Functions
A beginner-first guide to arrays in C, with tested programs for test scores, temperatures, a playlist and a cinema seat map.
Programming powers modern technology — from desktop software and websites to mobile apps, games and enterprise systems. Strong programming skills remain essential for developers, students and technology professionals building modern digital solutions.
MYCPLUS has been publishing programming tutorials, source code examples and practical development guides since 2004. This programming hub brings together tutorials for C, C++, C#, Java, JavaScript, PHP and Python, along with game development and real-world coding examples designed for hands-on learning.
You will find beginner-friendly programming tutorials, practical source code examples and advanced development guides covering object-oriented programming, debugging, modern programming techniques and professional software development practices. Whether you are learning your first language, improving coding skills or exploring modern development technologies, this section provides structured resources for real-world programming and software engineering.
Why MYCPLUS: One of the web’s longest-running programming resources — trusted since 2004 with hundreds of tutorials, practical coding guides, source code examples and developer learning resources designed for real-world programming skills.
A beginner-first guide to arrays in C, with tested programs for test scores, temperatures, a playlist and a cinema seat map.
Build a two-way serial chat between two PCs in C, from the null-modem wiring to raw-mode ports, message framing and error detection that works.
A beginner-first guide to C pointers: arrays, functions, dynamic memory, linked lists and function pointers, with every program compiled and tested.
A three-lane terminal racing game in C++17 with full source, and why random traffic made 994 of 1,000 races impossible to finish.
LRU and FIFO cache replacement in C, checked against Valgrind: a matrix walk that misses 100% of the time, and Belady’s anomaly.
Encapsulation in C++ with tested code: invariants, access specifiers, getter pitfalls, safe resource ownership, and how Python’s approach compares.
How C++ smart pointers own memory, measured: what each one costs in bytes and allocations, why shared_ptr cycles leak, and which one to use where.
What changes when a C++ class has two bases: offsets, ambiguous names, a duplicated base in the diamond, and who constructs a virtual base class.
How C++ inheritance works and where it fails quietly: default private bases, hidden overloads, a missing virtual destructor, and arrays of derived types.
One virtual function grew a class from 4 bytes to 16. Three kept it at 16. What vtables cost, measured, plus the destructor rule nobody mentions.
Eight memory errors that compile cleanly, which tools catch them, and the ownership habits that stop them: new and delete, RAII and smart pointers.
How C++ functions receive arguments and what each way costs, why overloads and defaults fail to compile, and the dangling return that builds anyway.