string - C++ pig latin translator -


im writes a program in C ++ which translates the pig into Latin, taking only the first letter of the word And by adding this to the end and adding "AE" example to the end, "Hello World" becomes "Elo Waldwe", but this is not working, ive tried in several different ways, whoever did no work About to leave at this point, please someone can help me do this okay.

  #include "stdafx.h" #include & lt; Iostream & gt; #include & lt; String & gt; using namespace std; Zero separator (four []); Int main () {string input; Const int size = 40; Sent four [SIZE]; Cout & lt; & Lt; "Enter the sentence" & lt; & Lt; Endl; Cin & gt; & Gt; Input; cin.getline (Sent, Size); Separator (Shipped); Cout & lt; & Lt; Input & lt; & Lt; Endl; System ("pause"); Return 0; } Zero separator (four input []) {int count = 0; Char x; While (input [count]! = '\ 0') count ++; If (islfa (input [count])) x = input [count]; If (input [count] == ​​'') input [count] = (x + '); If (input [count] == ​​'') input [count] = 'a'; }    

your cin> & Gt; Input; is getting the string from the first white spot, so the location between Hello and world .

This is the reason that it seems to delete everything but the first word, you should use something like std :: getline (std :: cin, input);

Comments

Popular posts from this blog

python - Writing Greek in matplotlib labels, titles -

c# - LINQ to Entities does not recognize the method 'Int32 IndexOf(System.String, System.StringComparison)' method -

Pygame memory leak with transform.flip -