Converting C to C++

Can anyone convert this code, which is in C, to C++ please??


#include <stdio.h>

int main()
{
int i = 0, m, l;
char strNames[50];
gets(strNames);


printf("First Name: ");
for( ; strNames[i] != 32; i++ )
printf("%c", strNames[i]);
m = i;
for( ; strNames[i] != '\0'; i++ );
for( ; strNames[i] != 32; i-- );
l = i;
printf("\nMiddle Name:");
for( ; m <= l; m++ )
printf("%c", strNames[m]);
printf("\nLast Name:");
for( ; strNames[l] != '\0'; l++ )
printf("%c", strNames[l]);
getchar();
return 0;
}
Copied code? No need to make new topics for this sort of thing, really.
http://www.cplusplus.com/forum/beginner/20294/#msg105917
Topic archived. No new replies allowed.