Audiovox P965 Scheda Tecnica Pagina 75

  • Scaricare
  • Aggiungi ai miei manuali
  • Stampa
  • Pagina
    / 280
  • Indice
  • SEGNALIBRI
  • Valutato. / 5. Basato su recensioni clienti
Vedere la pagina 74
API in C using winsock
72
else
{
stSentence->szSentence = realloc(stSentence->szSentence, iNewLength * sizeof stSentence->szSentence + 1);
}
// allocate mem for the full word string
stSentence->szSentence[stSentence->iLength] = malloc(strlen(szWordToAdd) + 1);
// copy word string to the sentence
strcpy(stSentence->szSentence[stSentence->iLength], szWordToAdd);
// update iLength
stSentence->iLength = iNewLength;
}
/********************************************************************
* Add a partial word to a sentence struct...useful for concatenation
********************************************************************/
void addPartWordToSentence(struct Sentence *stSentence, char *szWordToAdd)
{
int iIndex;
iIndex = stSentence->iLength - 1;
// reallocate memory for the new partial word
stSentence->szSentence[iIndex] = realloc(stSentence->szSentence[iIndex], strlen(stSentence->szSentence[iIndex]) + strlen(szWordToAdd) + 1);
// concatenate the partial word to the existing sentence
strcat (stSentence->szSentence[iIndex], szWordToAdd);
}
/********************************************************************
* Print a Sentence struct
********************************************************************/
void printSentence(struct Sentence *stSentence)
{
int i;
DEBUG ? printf("Sentence iLength = %d\n", stSentence->iLength) : 0;
DEBUG ? printf("Sentence iReturnValue = %d\n", stSentence->iReturnValue) : 0;
printf("Sentence iLength = %d\n", stSentence->iLength);
Vedere la pagina 74
1 2 ... 70 71 72 73 74 75 76 77 78 79 80 ... 279 280

Commenti su questo manuale

Nessun commento