Compiti ed esercitazioni VERIFICATO

C_strings accorgimenti logici e teorici prof: Caglioti

Politecnico di Milano ingegneria dell'automazione 2018
56 visualizzazioni
Nessun voto ancora
Condividi: WhatsApp Telegram
Anteprima pagina 1 — C_strings accorgimenti logici e teorici prof:  Caglioti

Stai vedendo l'anteprima delle prime pagine. Il file completo è gratis: registrati per leggerlo tutto.

Di cosa parla

  • A C string is an array of char containing characters followed by a null character \0.
  • To use strcpy in your program, include and use strcpy(string1, "some text") to insert text into a C string.
  • C strings can be initialized at declaration using { 'h', 'e', 'l', 'l', 'o', '\0' } or "hello"; an empty string is initialized as char string4[20] = "".
  • In memory, the characters of a C string are stored starting from index 0 until the null character \0, with elements after it irrelevant when used as a C string.

Questo appunto è gratis. Registrati in 30 secondi per leggere tutte le pagine e scaricarlo.

Altri appunti di FONDAMENTI DI INFORMATICA

Condividi questi appunti

WhatsApp Telegram