Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- void estraiNomeCognome(studente* a,char* nomeCogn,int n){
- char nome[50];
- char cognome[50];
- for(int i=0;i<strlen(nomeCogn);i++){
- if(nomeCogn[i]==';'){
- for(int j=0;j<i;j++){
- nome[j]=nomeCogn[j];
- }
- for(int j=i+1;j<strlen(nomeCogn);j++){
- cognome[j]=nomeCogn[j];
- }
- for(int j=0;j<strlen(nome);j++){
- if(nome[j]==','){
- nome[j]=' ';
- }
- }
- for(int j=0;j<strlen(cognome);j++){
- if(cognome[j]==','){
- cognome[j]=' ';
- }
- }
- cout<<nome<<endl;
- cout<<cognome<<endl;
- system("pause");
- }
- }
- nome[strlen(nome)+1]='\0';
- cognome[strlen(cognome)+1]='\0';
- strcpy(a[n].nome,nome);
- strcpy(a[n].cognome,cognome);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement