Porting from Pascal to C++

Posted by BP on Thu 14 Oct 2010 04:27 PM — 4 posts, 16,210 views.

#0
If one were to attempt to port a borland pascal program to C++ what would be the best approach.

BP
Australia Forum Administrator #1
Google "convert pascal to c++".

I found quite a few links.
#2
I searched and most require specfic files regarding the borland dialect for Pascal.
Australia Forum Administrator #3
What do you mean by "specific files"? Files you don't have?

This isn't a trivial exercise, Pascal and C are rather different languages. For a small program you could basically rewrite by looking at the intent. For larger programs it could be very tricky to get right.

Not only do you have the language differences, but the libraries themselves (which the code calls) may need to be converted or provided.

You haven't given much detail, like how big a project (how many lines), which version of Pascal, which version of C++ (eg. Microsoft, g++).

And why do it in the first place? Is this some code that does something that isn't available in C?

Years ago Borland had a write-up in their Borland C manual which described the differences between Pascal and C. Is that what you want, just to know roughly what is involved?