Hi
I bothered to read your program and corrected a few things. I hope that you read my program carefully and learn from it. I hope that it is not your homework.

Best regards
Chong

Code:
 
#include <iostream.h>
#include <string>
using namespace std;
main()
{
 string s1 = "1234", s2 = "456",s3;
 cout << "First string: "<<s1.c_str()<<'\n';
 cout << "Second string: " << s2.c_str() <<'\n';
 s3 = s1;
 for (int i=0;i<s2.size();i++){
  char c = s2[i];
  bool is_c_in_s3 =false;
  for (int j=0;j<s3.size();j++){
   if (c==s3[j]){
    is_c_in_s3 = true;
    break;
   }
  }//for
  if (!is_c_in_s3) s3+=c;
 }//for
 cout << "Final string: " << s3.c_str() << '\n';
}//main

Last edited by shabbir; 13Feb2012 at 15:05.. Reason: Code blocks