Solved

Urgent need help: a translator for pascal source program

Posted on 1997-04-05
7
220 Views
Last Modified: 2010-04-10
null
0
Comment
Question by:lugangxu
  • 5
7 Comments
 

Author Comment

by:lugangxu
ID: 1162579
Adjusted points to 215
0
 

Author Comment

by:lugangxu
ID: 1162580
Edited text of question
0
 

Author Comment

by:lugangxu
ID: 1162581
Adjusted points to 220
0
Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 
LVL 5

Expert Comment

by:yonat
ID: 1162582
0
 

Author Comment

by:lugangxu
ID: 1162583
Edited text of question
0
 

Author Comment

by:lugangxu
ID: 1162584
I've successfully made the  program myself!
0
 

Accepted Solution

by:
akapur earned 220 total points
ID: 1162585
Pascal is a procedural language.  So a translator will never be able to produce object oriented C++ code if that is what you want.  The best you can hope for is procedural code which is essentially C.  If you compile the C generated by p2c or ptoc with a C++ compiler you will get all the benefits of type checking that you would with C++ procedural code.  The only difference between procedural C code and procedural C++ code would be the use of streams instead of C I/O statements anyway. I suggest you use p2c of ptoc and if you must change the I/O statements to use streams instead.  Note that by doing this you will be slowing down your prog.  If you want an object oriented implementation of your program you will have to redesign your program.  No current program can convert a procedural design into object oriented design.  
0

Featured Post

Networking for the Cloud Era

Join Microsoft and Riverbed for a discussion and demonstration of enhancements to SteelConnect:
-One-click orchestration and cloud connectivity in Azure environments
-Tight integration of SD-WAN and WAN optimization capabilities
-Scalability and resiliency equal to a data center

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

  Included as part of the C++ Standard Template Library (STL) is a collection of generic containers. Each of these containers serves a different purpose and has different pros and cons. It is often difficult to decide which container to use and …
This article shows you how to optimize memory allocations in C++ using placement new. Applicable especially to usecases dealing with creation of large number of objects. A brief on problem: Lets take example problem for simplicity: - I have a G…
The goal of the tutorial is to teach the user how to use functions in C++. The video will cover how to define functions, how to call functions and how to create functions prototypes. Microsoft Visual C++ 2010 Express will be used as a text editor an…
The viewer will learn how to clear a vector as well as how to detect empty vectors in C++.

820 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question