0
             }
                                              else{
                                                   printf(" \b");
                                                   surname[cntr]='\0';
                                                   cntr--;
                                                   goto cc;
                                                   }
                                  }
                                  else{
                                       surname[cntr]=nput;
                                       cntr++;
                                       if(cntr>14){
                                                    goto aa;
                                                    }
                                                    else
                                                    goto cc;
                                       }
                      }
    aa:
    gotoxy(40,14);
    printf("%s %s",urname,surname);
    fullname[cntr]='\0';


{    
     char choice;
     ron:
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),11);
   gotoxy(35,15);
    printf(" Do you want to enter  ");
   gotoxy(35,16);
    printf(" another entry?        ");
   gotoxy(35,17);
    printf("                       ");
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),116);
   gotoxy(40,17); 
    printf("YES");
   gotoxy(50,17);
    printf("NO");
    choice= getche();
   if (choice=='y'){
   goto start;
}
  if (choice=='n'){
   printf("");
}
   else 
   goto ron;
}




}


void gotoxy(int x, int y){
     COORD coord = {x,y};
     SetConsoleCursorPosition(GetStdHandle(STD_OUTPUT_HANDLE),coord);


     }

example output:

Please Enter your name : Ron
Please Enter your Surname : Smash
Your name is : r.Smash

// just an example that i input my name Ron and a surname Smash
my question is how to make the output in Your name is : is only
r.Smash

3
Contributors
2
Replies
16
Views
2 Years
Discussion Span
Last Post by ddanbe
0

Is that just a random piece of code you found?

In your code proper.

cout << "Your name is: " << firstmame[0] << "." << surname << endl;

0

I assume this is Turbo C?
From K&R "The C programming language" second edition page 65:

3.8 Goto and Labels
C provdes the infinitely-abusable goto statement, and labels to branch to.
Formally, the goto is never necessary, and in practice it is almost always easy to write code without it.

Suggestion: look up a C tutorial on the net and learn how to use printf and strings to start with.
Forget about goto and join the 21st century!

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.