Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //============================================================================
- // Name : UsaVettore.cpp
- // Author : Vincenzo
- // Version :
- // Copyright : All rights reserved.
- // Description : Finding a single character occurrences in a characters'vector (string)
- //============================================================================
- #include <iostream>
- #include "Vettore.h"
- using namespace std;
- int main()
- {
- string frase = ""; //frase inizializzata con stringa nulla
- char ast = '\0'; //ast inizializata al carattere nullo
- cout << "Inserire frase:" << endl;
- leggiFrase(frase); //procedura per la lettura da tastiera della frase
- cout << "Inserire carattere da ricercare: " << endl;
- leggiAst(ast); //procedura per la lettura da tastiera del carattere
- int numOccorrenze = RicercaInFrase(frase, ast); //restituisce il numero di occorrenze di AST
- cout << "Occorrenze di " << ast << ": " << numOccorrenze << endl; //stampa il numero di occorrenze
- return 0; //restituisci al sistema operativo il valore 0 per indicare che il programma si è concluso con successo
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement