C++/Convert

Advertisement


Question
Hi
I want to write a program that get a program in Pascal language and convert it to a C language program.
the input program will get in character type and just include some statements such as (read , write,begin ,var,if,case sellector,...).
in fact I like you to guide me that how in C language we can get a text in char type and change or replace some of it's data and print it again.
thanks  

Answer
char str[100];
cin.getline(str, 100);

the above reads one line of character string. then you should modify, as you wish by accessing the elements (like str[5]), and finally display:

cout << str;

However this is not the only thing you should do. Converting a pascal program to C program is more complicated, as you need to somehow understand the structure of pascal code, inside your program (parsing).

C++

All Answers


Answers by Expert:


Ask Experts

Volunteer


Sam

Expertise

You may ask me about simple to complicated C/C++ programming methods/style and most like questions about network programming in C++.

Experience

I'm a professional programer in C++ and network/internet programming.

©2016 About.com. All rights reserved.