I am currently having problems making my basic prog a cpp prog.
Here's what I am trying to do.
Step 1) Read a string from a file.
Step 2) Read the string character by character.
Step 3) Get each character's ascii value into an integer.
Step 4) Get the character back into the string.
Step 5) Put the character back into another string, in the same order.
Steps 2 - 5, I don't know in C++, reading files, I know.
Here is my VB Code:
open "FILE" for input as 1
input #1, string$
a = len(string$)
for i = 1 to a ' For loop that goes until the end of the string
b$ = mid(string$, i, 1) ' b$ become 1 character each cycle.
c = asc(b$) ' c equals the ascii value of b$
c = c + 5 ' self explanatory
b$ = chr$(c) ' b$ = the new character
d$ = d$ + b$ ' d$ become the new string.
say the string was: HI
the output would be: MN
I want to do this in C++, but have no clue where to start.
Any help would be great.