Politechnika Śląska - strona 150

Books on C++

  • Politechnika Śląska
  • dr inż. Piotr Fabian
  • Computer Programming
Pobrań: 0
Wyświetleń: 882

Books on C++  Bjarne Stroustrup „Język C++”, WNT  International Standard for Information Systems - Programming Language C++ (draft), ANSI  Stroustrup B.: Projektowanie i rozwój języka C++. WNT, Warszawa  Plauger P. J., Biblioteka sta...

Strcat

  • Politechnika Śląska
  • dr inż. Piotr Fabian
  • Fundamentals of Computer Programming
Pobrań: 7
Wyświetleń: 2177

Strcat  char *strcat(char *dest, const char *src);  strcat appends a copy of src to the end of dest  The length of the resulting string is strlen(dest) + strlen(src)  strcat returns a pointer to the concatenated Strings #include #include int...

Strchr

  • Politechnika Śląska
  • dr inż. Piotr Fabian
  • Fundamentals of Computer Programming
Pobrań: 0
Wyświetleń: 2303

Strchr  char *strchr(const char *s, int c);  Scans a string for the first occurence of a given character  The null-terminator is considered to be part of the string  If c does not occur in s, returns NULL #include #include int main() { char string[20]; char *ptr, c = 'r'; strcpy(string, "...

Strcmp

  • Politechnika Śląska
  • dr inż. Piotr Fabian
  • Fundamentals of Computer Programming
Pobrań: 0
Wyświetleń: 2100

Strcmp  int strcmp(const char *s1, const char*s2);  strcmp performs an unsigned comparison of s1 to s2  Returned value: - 0 if s1 s2 #include #include int main() { char *buf1 = "alice", *buf2 = "andrew"; int p; p = strcmp(buf2, buf1); if (p 0)

Strcpy

  • Politechnika Śląska
  • dr inż. Piotr Fabian
  • Fundamentals of Computer Programming
Pobrań: 0
Wyświetleń: 2471

Strcpy  char *strcpy(char *dest, const char *src);  Copies string src to dest - (order of arguments: like in an assignment ”dest=src”) #include #include int main() { char string[10]; /* long enough to hold a copy of str1 */ char *str1 = "first"; strcpy(string, str1);

Strpbrk

  • Politechnika Śląska
  • dr inż. Piotr Fabian
  • Fundamentals of Computer Programming
Pobrań: 0
Wyświetleń: 2422

Strpbrk  char *strpbrk(const char *s1, const char *s2);  strpbrk scans a string, s1, for the first occurrence of any character appearing in s2  On success, strpbrk returns a pointer to the first occurrence of any of the characters in s2  If no...

Strtok

  • Politechnika Śląska
  • dr inż. Piotr Fabian
  • Fundamentals of Computer Programming
Pobrań: 0
Wyświetleń: 2408

Strtok  char *strtok(char *s1, const char *s2);  strtok considers the string s1 to consist of a sequence of zero or more text tokens, separated by spans of one or more characters from the separator string s2  The first call to strtok - returns a po...

Summary of functions operating on raw memory

  • Politechnika Śląska
  • dr inż. Piotr Fabian
  • Fundamentals of Computer Programming
Pobrań: 7
Wyświetleń: 448

Summary of functions operating on raw memory  memccpy copies a block of n bytes from src to dest  memcpy copies a block of n bytes from src to dest  memmove copies a block of n bytes from src to dest  memchr searches the first n bytes of array ...

Inserting a new element

  • Politechnika Śląska
  • dr inż. Piotr Fabian
  • Fundamentals of Computer Programming
Pobrań: 0
Wyświetleń: 735

Inserting a new element: int insert(bn *p, bn **root) { if (*root && (*root)-data == p-data) return 1; /* already present */ if (!*root) { /* empty tree */ *root = p; return 0; } else if (p-data (*root)-data) insert(p,&((*root)-right)); else insert(p,&((*root)-left)); return 0; } i...

Memcpy

  • Politechnika Śląska
  • dr inż. Piotr Fabian
  • Fundamentals of Computer Programming
Pobrań: 0
Wyświetleń: 833

Memcpy  void *memcpy (void *dest, const void *src, size_t n);  Copies a block of n bytes from src to dest  If src and dest overlap, the behavior is Undefined #include #include int main() { char src[] = ""; char dest[] = "abcdefghijlkmnopqrstuvwxyz0123456709"; char *ptr;