SlideShare a Scribd company logo
1 of 10
Programming Embedded 
Systems in C++ 
A C to C++ Migration Strategy 
20 May 2014 
Colin Walls, Mentor Graphics 
1
This is what a question slide will 
look like. 
Please answer in the chat. 
Also, questions to me start with ? 
2 
[ # ]
Agenda 
Monday: C++ for Embedded Programming 
Tuesday: C to C++ Migration Strategy 
Wednesday: C++ and a Real Time Operating 
System 
Thursday: Case study #1 
Friday: Case Study #2 
3
What language are you 
using for embedded 
development today? 
4 
[ 1 ]
C to C++ Migration 
• Three stage process: 
– exploit reusability 
• new code in C++ 
• link with C code 
– treat C as C++ 
• clean up C code to comply with C++ 
– start using C++ language features 
5
Apply Reusability 
• All new code in C++ 
– link with existing C modules 
• Problem with typesafe linkage 
– C++ function names and references manged 
fun(int) becomes fun_int(int) 
– C functions not mangled 
fun(int) unchanged 
– use extern "C" 
extern "C" 
{ 
void funx(int); 
int fun(float); 
... 
} 
6
Clean C 
• ANSI C is essentially a subset of C++ 
• Numerous minor exceptions 
• Clean C is true subset 
– code written or modified to accommodate exceptions 
– still ANSI C 
– specific points to address 
• Treat Clean C as if it were C++ 
– acceptable to C++ compiler 
– type-safe linkage OK 
7
Clean C 
• Function prototypes are mandatory 
• Implicit types casts are a problem 
– use explicit – like (char) 
• Enumerated types are taken “seriously” 
• Character arrays must have room for 
terminator 
char str[3] = "xyz"; is not acceptable 
char str[] = "xyz"; is better 
8
Clean C 
C: 
Nested structures need care 
struct out 
{ 
struct in { int i; } m; 
int j; 
}; 
struct in inner; 
struct out outer; 
Clean C: 
struct in { int i; }; 
struct out 
{ 
struct in m; 
int j; 
}; 
struct in inner; 
struct out outer; 
9
To view the rest of this course, 
visit the full recorded version on Design News. 
10

More Related Content

What's hot

Write a complete C++ program that does the following: 1. The program will c...
Write a complete C++ program that does the following:   1. The program will c...Write a complete C++ program that does the following:   1. The program will c...
Write a complete C++ program that does the following: 1. The program will c...licservernoida
 
C++17 not your father’s c++
C++17  not your father’s c++C++17  not your father’s c++
C++17 not your father’s c++Patrick Viafore
 
Programs that work in c and not in c
Programs that work in c and not in cPrograms that work in c and not in c
Programs that work in c and not in cAjay Chimmani
 
Two C++ Tools: Compiler Explorer and Cpp Insights
Two C++ Tools: Compiler Explorer and Cpp InsightsTwo C++ Tools: Compiler Explorer and Cpp Insights
Two C++ Tools: Compiler Explorer and Cpp InsightsAlison Chaiken
 
[Question Paper] Object Oriented Programming With C++ (Revised Course) [April...
[Question Paper] Object Oriented Programming With C++ (Revised Course) [April...[Question Paper] Object Oriented Programming With C++ (Revised Course) [April...
[Question Paper] Object Oriented Programming With C++ (Revised Course) [April...Mumbai B.Sc.IT Study
 
C mcq practice test 1
C mcq practice test 1C mcq practice test 1
C mcq practice test 1Aman Kamboj
 
2014-06-26 - A guide to undefined behavior in c and c++
2014-06-26 - A guide to undefined behavior in c and c++2014-06-26 - A guide to undefined behavior in c and c++
2014-06-26 - A guide to undefined behavior in c and c++Chen-Han Hsiao
 
Armstrong calculator
Armstrong calculatorArmstrong calculator
Armstrong calculatorJayantBhatt6
 
[Question Paper] Advanced SQL (Revised Course) [April / 2014]
[Question Paper] Advanced SQL (Revised Course) [April / 2014][Question Paper] Advanced SQL (Revised Course) [April / 2014]
[Question Paper] Advanced SQL (Revised Course) [April / 2014]Mumbai B.Sc.IT Study
 
情報委員会説明プレゼン@オリエンテーション
情報委員会説明プレゼン@オリエンテーション情報委員会説明プレゼン@オリエンテーション
情報委員会説明プレゼン@オリエンテーションTakaki Yoneyama
 
2021 National Poison Prevention Week Poster Showcase
2021 National Poison Prevention Week Poster Showcase2021 National Poison Prevention Week Poster Showcase
2021 National Poison Prevention Week Poster ShowcaseMRPCAP
 

What's hot (19)

C++ day2
C++ day2C++ day2
C++ day2
 
Write a complete C++ program that does the following: 1. The program will c...
Write a complete C++ program that does the following:   1. The program will c...Write a complete C++ program that does the following:   1. The program will c...
Write a complete C++ program that does the following: 1. The program will c...
 
Unit iv
Unit ivUnit iv
Unit iv
 
C++17 not your father’s c++
C++17  not your father’s c++C++17  not your father’s c++
C++17 not your father’s c++
 
Lecture02
Lecture02Lecture02
Lecture02
 
1 c introduction
1 c introduction1 c introduction
1 c introduction
 
Programs that work in c and not in c
Programs that work in c and not in cPrograms that work in c and not in c
Programs that work in c and not in c
 
Two C++ Tools: Compiler Explorer and Cpp Insights
Two C++ Tools: Compiler Explorer and Cpp InsightsTwo C++ Tools: Compiler Explorer and Cpp Insights
Two C++ Tools: Compiler Explorer and Cpp Insights
 
[Question Paper] Object Oriented Programming With C++ (Revised Course) [April...
[Question Paper] Object Oriented Programming With C++ (Revised Course) [April...[Question Paper] Object Oriented Programming With C++ (Revised Course) [April...
[Question Paper] Object Oriented Programming With C++ (Revised Course) [April...
 
C mcq practice test 1
C mcq practice test 1C mcq practice test 1
C mcq practice test 1
 
2014-06-26 - A guide to undefined behavior in c and c++
2014-06-26 - A guide to undefined behavior in c and c++2014-06-26 - A guide to undefined behavior in c and c++
2014-06-26 - A guide to undefined behavior in c and c++
 
Armstrong calculator
Armstrong calculatorArmstrong calculator
Armstrong calculator
 
Tricks
TricksTricks
Tricks
 
01 basic programming in c++
01 basic programming in c++01 basic programming in c++
01 basic programming in c++
 
[Question Paper] Advanced SQL (Revised Course) [April / 2014]
[Question Paper] Advanced SQL (Revised Course) [April / 2014][Question Paper] Advanced SQL (Revised Course) [April / 2014]
[Question Paper] Advanced SQL (Revised Course) [April / 2014]
 
情報委員会説明プレゼン@オリエンテーション
情報委員会説明プレゼン@オリエンテーション情報委員会説明プレゼン@オリエンテーション
情報委員会説明プレゼン@オリエンテーション
 
C++
C++C++
C++
 
2021 National Poison Prevention Week Poster Showcase
2021 National Poison Prevention Week Poster Showcase2021 National Poison Prevention Week Poster Showcase
2021 National Poison Prevention Week Poster Showcase
 
Compiler lec 3
Compiler lec 3Compiler lec 3
Compiler lec 3
 

Viewers also liked

C++ and Embedded Linux - a perfect match
C++ and Embedded Linux - a perfect matchC++ and Embedded Linux - a perfect match
C++ and Embedded Linux - a perfect matchVinícius Tadeu Zein
 
AUTOMATED TESTING USING PYTHON (ATE)
AUTOMATED TESTING USING PYTHON (ATE)AUTOMATED TESTING USING PYTHON (ATE)
AUTOMATED TESTING USING PYTHON (ATE)Yuvaraja Ravi
 
Automated Python Test Frameworks for Hardware Verification and Validation
Automated Python Test Frameworks for Hardware Verification and ValidationAutomated Python Test Frameworks for Hardware Verification and Validation
Automated Python Test Frameworks for Hardware Verification and ValidationBarbara Jones
 
Automated hardware testing using python
Automated hardware testing using pythonAutomated hardware testing using python
Automated hardware testing using pythonYuvaraja Ravi
 
Automated Testing for Embedded Software in C or C++
Automated Testing for Embedded Software in C or C++Automated Testing for Embedded Software in C or C++
Automated Testing for Embedded Software in C or C++Lars Thorup
 
Automated Regression Testing for Embedded Systems in Action
Automated Regression Testing for Embedded Systems in ActionAutomated Regression Testing for Embedded Systems in Action
Automated Regression Testing for Embedded Systems in ActionAANDTech
 

Viewers also liked (8)

C++ and Embedded Linux - a perfect match
C++ and Embedded Linux - a perfect matchC++ and Embedded Linux - a perfect match
C++ and Embedded Linux - a perfect match
 
AUTOMATED TESTING USING PYTHON (ATE)
AUTOMATED TESTING USING PYTHON (ATE)AUTOMATED TESTING USING PYTHON (ATE)
AUTOMATED TESTING USING PYTHON (ATE)
 
Python in Test automation
Python in Test automationPython in Test automation
Python in Test automation
 
Automated Python Test Frameworks for Hardware Verification and Validation
Automated Python Test Frameworks for Hardware Verification and ValidationAutomated Python Test Frameworks for Hardware Verification and Validation
Automated Python Test Frameworks for Hardware Verification and Validation
 
Embedded System Test Automation
Embedded System Test AutomationEmbedded System Test Automation
Embedded System Test Automation
 
Automated hardware testing using python
Automated hardware testing using pythonAutomated hardware testing using python
Automated hardware testing using python
 
Automated Testing for Embedded Software in C or C++
Automated Testing for Embedded Software in C or C++Automated Testing for Embedded Software in C or C++
Automated Testing for Embedded Software in C or C++
 
Automated Regression Testing for Embedded Systems in Action
Automated Regression Testing for Embedded Systems in ActionAutomated Regression Testing for Embedded Systems in Action
Automated Regression Testing for Embedded Systems in Action
 

Similar to C to C++ Migration Strategy

Modern C++ Lunch and Learn
Modern C++ Lunch and LearnModern C++ Lunch and Learn
Modern C++ Lunch and LearnPaul Irwin
 
Computer Programming
Computer ProgrammingComputer Programming
Computer ProgrammingBurhan Fakhar
 
Review chapter 1 2-3
Review chapter 1 2-3Review chapter 1 2-3
Review chapter 1 2-3ahmed22dg
 
Object oriented programming 7 first steps in oop using c++
Object oriented programming 7 first steps in oop using  c++Object oriented programming 7 first steps in oop using  c++
Object oriented programming 7 first steps in oop using c++Vaibhav Khanna
 
C++ programming intro
C++ programming introC++ programming intro
C++ programming intromarklaloo
 
lecture02-cpp.ppt
lecture02-cpp.pptlecture02-cpp.ppt
lecture02-cpp.pptDevliNeeraj
 
9781285852744 ppt ch02
9781285852744 ppt ch029781285852744 ppt ch02
9781285852744 ppt ch02Terry Yoast
 
C++ for Embedded Programming
C++ for Embedded ProgrammingC++ for Embedded Programming
C++ for Embedded ProgrammingColin Walls
 
Presentation on C++ Programming Language
Presentation on C++ Programming LanguagePresentation on C++ Programming Language
Presentation on C++ Programming Languagesatvirsandhu9
 

Similar to C to C++ Migration Strategy (20)

Modern C++ Lunch and Learn
Modern C++ Lunch and LearnModern C++ Lunch and Learn
Modern C++ Lunch and Learn
 
Computer Programming
Computer ProgrammingComputer Programming
Computer Programming
 
Review chapter 1 2-3
Review chapter 1 2-3Review chapter 1 2-3
Review chapter 1 2-3
 
Object oriented programming 7 first steps in oop using c++
Object oriented programming 7 first steps in oop using  c++Object oriented programming 7 first steps in oop using  c++
Object oriented programming 7 first steps in oop using c++
 
College1
College1College1
College1
 
C++ programming intro
C++ programming introC++ programming intro
C++ programming intro
 
Effective C++
Effective C++Effective C++
Effective C++
 
lecture02-cpp.ppt
lecture02-cpp.pptlecture02-cpp.ppt
lecture02-cpp.ppt
 
lecture02-cpp.ppt
lecture02-cpp.pptlecture02-cpp.ppt
lecture02-cpp.ppt
 
lecture02-cpp.ppt
lecture02-cpp.pptlecture02-cpp.ppt
lecture02-cpp.ppt
 
lecture02-cpp.ppt
lecture02-cpp.pptlecture02-cpp.ppt
lecture02-cpp.ppt
 
C#unit4
C#unit4C#unit4
C#unit4
 
9781285852744 ppt ch02
9781285852744 ppt ch029781285852744 ppt ch02
9781285852744 ppt ch02
 
Return of c++
Return of c++Return of c++
Return of c++
 
C++ for Embedded Programming
C++ for Embedded ProgrammingC++ for Embedded Programming
C++ for Embedded Programming
 
C++.ppt
C++.pptC++.ppt
C++.ppt
 
c++ ppt.ppt
c++ ppt.pptc++ ppt.ppt
c++ ppt.ppt
 
11 cpp
11 cpp11 cpp
11 cpp
 
L6
L6L6
L6
 
Presentation on C++ Programming Language
Presentation on C++ Programming LanguagePresentation on C++ Programming Language
Presentation on C++ Programming Language
 

Recently uploaded

The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptxThe Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptxLoriGlavin3
 
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxMerck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxLoriGlavin3
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024Lorenzo Miniero
 
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenHervé Boutemy
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr BaganFwdays
 
Scale your database traffic with Read & Write split using MySQL Router
Scale your database traffic with Read & Write split using MySQL RouterScale your database traffic with Read & Write split using MySQL Router
Scale your database traffic with Read & Write split using MySQL RouterMydbops
 
DSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningDSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningLars Bell
 
Moving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfMoving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfLoriGlavin3
 
Rise of the Machines: Known As Drones...
Rise of the Machines: Known As Drones...Rise of the Machines: Known As Drones...
Rise of the Machines: Known As Drones...Rick Flair
 
Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 3652toLead Limited
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brandgvaughan
 
Take control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteTake control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteDianaGray10
 
How to write a Business Continuity Plan
How to write a Business Continuity PlanHow to write a Business Continuity Plan
How to write a Business Continuity PlanDatabarracks
 
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxUse of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxLoriGlavin3
 
From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .Alan Dix
 
unit 4 immunoblotting technique complete.pptx
unit 4 immunoblotting technique complete.pptxunit 4 immunoblotting technique complete.pptx
unit 4 immunoblotting technique complete.pptxBkGupta21
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Commit University
 
TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024Lonnie McRorey
 
The State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxThe State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxLoriGlavin3
 

Recently uploaded (20)

The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptxThe Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
 
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxMerck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024
 
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache Maven
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan
 
Scale your database traffic with Read & Write split using MySQL Router
Scale your database traffic with Read & Write split using MySQL RouterScale your database traffic with Read & Write split using MySQL Router
Scale your database traffic with Read & Write split using MySQL Router
 
DSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningDSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine Tuning
 
Moving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfMoving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdf
 
Rise of the Machines: Known As Drones...
Rise of the Machines: Known As Drones...Rise of the Machines: Known As Drones...
Rise of the Machines: Known As Drones...
 
Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brand
 
Take control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteTake control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test Suite
 
How to write a Business Continuity Plan
How to write a Business Continuity PlanHow to write a Business Continuity Plan
How to write a Business Continuity Plan
 
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxUse of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
 
From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .
 
unit 4 immunoblotting technique complete.pptx
unit 4 immunoblotting technique complete.pptxunit 4 immunoblotting technique complete.pptx
unit 4 immunoblotting technique complete.pptx
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!
 
TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024
 
The State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxThe State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptx
 

C to C++ Migration Strategy

  • 1. Programming Embedded Systems in C++ A C to C++ Migration Strategy 20 May 2014 Colin Walls, Mentor Graphics 1
  • 2. This is what a question slide will look like. Please answer in the chat. Also, questions to me start with ? 2 [ # ]
  • 3. Agenda Monday: C++ for Embedded Programming Tuesday: C to C++ Migration Strategy Wednesday: C++ and a Real Time Operating System Thursday: Case study #1 Friday: Case Study #2 3
  • 4. What language are you using for embedded development today? 4 [ 1 ]
  • 5. C to C++ Migration • Three stage process: – exploit reusability • new code in C++ • link with C code – treat C as C++ • clean up C code to comply with C++ – start using C++ language features 5
  • 6. Apply Reusability • All new code in C++ – link with existing C modules • Problem with typesafe linkage – C++ function names and references manged fun(int) becomes fun_int(int) – C functions not mangled fun(int) unchanged – use extern "C" extern "C" { void funx(int); int fun(float); ... } 6
  • 7. Clean C • ANSI C is essentially a subset of C++ • Numerous minor exceptions • Clean C is true subset – code written or modified to accommodate exceptions – still ANSI C – specific points to address • Treat Clean C as if it were C++ – acceptable to C++ compiler – type-safe linkage OK 7
  • 8. Clean C • Function prototypes are mandatory • Implicit types casts are a problem – use explicit – like (char) • Enumerated types are taken “seriously” • Character arrays must have room for terminator char str[3] = "xyz"; is not acceptable char str[] = "xyz"; is better 8
  • 9. Clean C C: Nested structures need care struct out { struct in { int i; } m; int j; }; struct in inner; struct out outer; Clean C: struct in { int i; }; struct out { struct in m; int j; }; struct in inner; struct out outer; 9
  • 10. To view the rest of this course, visit the full recorded version on Design News. 10