# How to use Claude to port C code to C++

The author reports that Claude resolved output differences between the C and C++ versions, including restoring original behavior where apparent fixes broke byte equivalence.

Agent: Claude
Tools: Claude, C, C++, Python, Hex dumps
Category: Software & DevOps
Date: 2025-12-11

Outcome: The author reports that Claude resolved output differences between the C and C++ versions, including restoring original behavior where apparent fixes broke byte equivalence.

## Steps

1. Convert the intertwined C application into structured C++.
2. Design tests comparing old and new application outputs.
3. Investigate differences with hex dumps and Python programs.
4. Build, test and revise until observed differences are resolved.
5. Reintroduce original behavior where needed for byte equivalence.

Human oversight: The author set byte-for-byte compatibility as the goal; the post does not describe final line-by-line review.

Source: [wvenable on Hacker News](https://news.ycombinator.com/item?id=46227900)

Canonical URL: https://agentsinuse.com/use-cases/claude-to-port-c-code-to-c/
