Thread: c++ help needed

  1. #16
    Registered User
    Join Date
    Jan 2008
    Posts
    8
    Eureka !!!
    It is almost perfect, there is only one issue, namely that now after Bartolomeo was inserted the character | And the problem is that I use this character to separate the fields of any record.
    The field Messaggio: in a first time was
    Code:
    Bartolomeo
    Now the field Messaggio: became
    Code:
       Bartolomeo.|Un Simone di Bartolomeo fu pretore di Palermo 1414-15; un Leonardo dottore in ambo le leggi e protonotaro del regno ebbe in enfiteusi il tenimento di terre nominato la Tarbia (Trabia), che nell’anno 1444 ebbe confermato dal viceré. A lui succedette Narduccio (Leonardo) suo figlio, che fu senatore di Palermo nell’anno 1475 ed ebbe un’unica figlia, che sposò il dottor Blasco Lancea (per Lanza) che, nell’anno 1509, ottenne infeudazione del territorio della Trabia.Arma: d’oro, al castello merlato di tre pezzi di nero, accostato da due rose di rosso.
    Instead should be
    Code:
       Bartolomeo. Un Simone di Bartolomeo fu pretore di Palermo 1414-15; un Leonardo dottore in ambo le leggi e protonotaro del regno ebbe in enfiteusi il tenimento di terre nominato la Tarbia (Trabia), che nell’anno 1444 ebbe confermato dal viceré. A lui succedette Narduccio (Leonardo) suo figlio, che fu senatore di Palermo nell’anno 1475 ed ebbe un’unica figlia, che sposò il dottor Blasco Lancea (per Lanza) che, nell’anno 1509, ottenne infeudazione del territorio della Trabia.Arma: d’oro, al castello merlato di tre pezzi di nero, accostato da due rose di rosso.
    without the character |

  2. #17
    Jack of many languages Dino's Avatar
    Join Date
    Nov 2007
    Location
    Chappell Hill, Texas
    Posts
    2,332
    OK, I edited the post. Remove the fputs() that is in blue.

    Todd

  3. #18
    Registered User
    Join Date
    Jan 2008
    Posts
    8

    Thumbs up

    I tried to modify the code from
    Code:
     pDest = strstr(strAppo, "Messaggio:");
    
    		if (pDest != NULL)
    		{
    			in_message = 1 ; // set to true 
    			strAppo1[0] = 0;
    			lenstr = strlen(pDest + 10);
    			strncpy (strAppo1, pDest + 10, lenstr - 1);
    			strAppo1[lenstr - 1] = 0;
    			fputs("|", pfOut);
    			fputs(strAppo1, pfOut);
    			fputs("|", pfOut);
    		}
    to
    Code:
     pDest = strstr(strAppo, "Messaggio:");
    
    		if (pDest != NULL)
    		{
    			in_message = 1 ; // set to true 
    			strAppo1[0] = 0;
    			lenstr = strlen(pDest + 10);
    			strncpy (strAppo1, pDest + 10, lenstr - 1);
    			strAppo1[lenstr - 1] = 0;
    			fputs("|", pfOut);
    			fputs(strAppo1, pfOut);
    			
    		}
    and the program seems working fine

    I'm very happy
    You fixed all my issues

    thanks
    Last edited by ettore; 01-18-2008 at 12:26 PM.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. free needed or not?
    By quantt in forum Linux Programming
    Replies: 3
    Last Post: 06-25-2009, 09:32 AM
  2. C Programmers needed for Direct Hire positions
    By canefan in forum Projects and Job Recruitment
    Replies: 0
    Last Post: 09-24-2008, 11:55 AM
  3. lock needed in this scenario?
    By George2 in forum C# Programming
    Replies: 1
    Last Post: 05-25-2008, 07:22 AM
  4. C++ help needed
    By Enkindu in forum Projects and Job Recruitment
    Replies: 3
    Last Post: 08-31-2004, 11:24 PM
  5. semi-colon - where is it needed
    By kes103 in forum C++ Programming
    Replies: 8
    Last Post: 09-12-2003, 05:24 PM