Audiovox P965 Datový list Strana 74

  • Stažení
  • Přidat do mých příruček
  • Tisk
  • Strana
    / 280
  • Tabulka s obsahem
  • KNIHY
  • Hodnocené. / 5. Na základě hodnocení zákazníků
Zobrazit stránku 73
API in C using winsock
71
// update iLength
stBlock->iLength = iNewLength;
DEBUG ? printf("addSentenceToBlock stBlock->iLength=%d\n", stBlock->iLength) : 0;
}
/********************************************************************
* Initialize a new sentence
********************************************************************/
void initializeSentence(struct Sentence *stSentence)
{
DEBUG ? printf("initializeSentence\n") : 0;
stSentence->iLength = 0;
stSentence->iReturnValue = 0;
}
/********************************************************************
* Clear an existing sentence
********************************************************************/
void clearSentence(struct Sentence *stSentence)
{
DEBUG ? printf("initializeSentence\n") : 0;
free(stSentence->szSentence);
initializeSentence(stSentence);
}
/********************************************************************
* Add a word to a sentence struct
********************************************************************/
void addWordToSentence(struct Sentence *stSentence, char *szWordToAdd)
{
int iNewLength;
iNewLength = stSentence->iLength + 1;
// allocate mem for the new word position
if (stSentence->iLength == 0)
{
stSentence->szSentence = malloc(1 * sizeof stSentence->szSentence);
}
Zobrazit stránku 73
1 2 ... 69 70 71 72 73 74 75 76 77 78 79 ... 279 280

Komentáře k této Příručce

Žádné komentáře