The C programming language remains a foundational technology in computer science and software engineering. It underpins operating systems, embedded systems, and many performance-critical applications. For developers trained in higher-level languages such as Java, learning C provides deeper insight into memory management, compilation, and low-level program behavior.
Understanding C is particularly relevant for students and professionals working in systems programming, embedded development, or performance-sensitive domains. Because Java was historically derived from C, transitioning between the two languages offers both familiarity and conceptual contrast.
About the book
C for Java Programmers by George Ferguson is designed specifically for readers who are already proficient in Java and need to learn C. Rather than introducing programming from first principles, the book assumes fluency in Java and builds on that foundation.
The text compares Java and C directly, highlighting both structural similarities and critical differences. It addresses the historical context of C, its minimalist design, and its lower-level control over memory and execution. The material emphasizes disciplined programming practices, given that C provides fewer built-in safeguards than Java.
The book is not presented as a comprehensive language specification. Instead, it functions as a structured transition guide for experienced Java programmers who want to understand how C works, how programs are compiled and executed, and how to manage memory explicitly.
What you will learn
Readers will learn how C programs are structured and executed, including how development workflows differ from Java. The book introduces core C constructs such as primitive types, expressions, control flow, functions, arrays, and strings, while contrasting them with their Java equivalents.
A significant portion of the text is devoted to memory management. Topics include pointers, passing arguments by reference, dynamic memory allocation in both Java and C, dynamic arrays, and dynamic data structures. These sections are especially relevant for readers seeking a deeper understanding of how programs use memory.
The book also covers structured types, defining new types, file organization, libraries, the C preprocessor, compilation and linking, and debugging techniques. By working through these topics, readers gain practical knowledge of how C programs are built, organized, and maintained at scale.
Table of contents
- 1 Introduction
- 2 Overview of Java and C
- 2.1 What’s The Same?
- 2.2 What’s Different?
- 3 Development and Execution
- 3.1 Development and Execution in Java and C
- 3.2 Setting Up Your Development Environment
- 3.3 Writing Your First C Program
- 3.4 Compiling Your First C Program
- 4 Basic Expressions and Statements
- 4.1 Comments
- 4.2 Primitive Types
- 4.3 Producing Output
- 4.4 Operators and Expressions
- 4.5 Variables and Assignment
- 4.6 Arrays
- 4.6.1 Things Missing from Arrays in C
- 4.6.2 Multi-dimensional Arrays
- 4.7 Strings
- 5 Control Flow
- 5.1 Conditional Statements
- 5.2 Iteration Statements
- 5.3 Other Control Flow Statements
- 6 Functions
- 6.1 Function Parameters and Arguments
- 6.2 Function Declarations
- 7 Structured Types
- 8 Memory Management
- 8.1 Variables, Addresses, and Pointers
- 8.2 Passing Arguments by Reference
- 8.3 Memory Allocation
- 8.4 Dynamic Memory Allocation in Java
- 8.5 Dynamic Memory Allocation in C
- 8.6 Dynamic Arrays
- 8.6.1 Pointers vs. Multi-dimensional Arrays
- 8.7 Dynamic Data Structures
- 8.8 Function Pointers
- 9 Defining New Types
- 10 Sharing Code: Files and Libraries
- 10.1 The C Preprocessor
- 10.2 Separate Compilation, Libraries, and Linking
- 10.3 Standard System Libraries
- 10.3.1 stdlib.h: The C Standard Library
- 10.3.2 stdio.h: The Standard Input/Output (I/O) Library
- Reading input from the user
- 10.3.3 math.h: The C Math Library
- 10.3.4 string.h: The C String Library
- 10.3.5 stdbool.h: The C Boolean Library
- 10.3.6 Functionality NOT in the C standard library
- 10.4 Project Development
- 10.5 Building Larger C Programs
- 11 Debugging a C Program
- 11.1 Debuggers
- 11.2 Compiler Options
- 11.3 Debugging Memory Problems
- 12 Final Thoughts
- 13 References
5. Book details
- Title: C for Java Programmers
- Author(s): George Ferguson
- Main category: Programming
- Subcategory: C
- Language: English
- License: Creative Commons Attribution-ShareAlike 4.0 International License
More books in: C, Programming
Legal notice: This book is shared for educational purposes only. The content is distributed under Creative Commons licenses or with explicit permission from the author. FreeProgrammingBooks may host files that comply with their respective licenses.