Lab 14 – 2017

Slides: [ EST ][ ENG ]

Useful posts: [ Strings ] [ Standard libraries ] [ Formatted data ]

Task (2.5p)

Create a program with:

2 predefined strings, 2 char buffers, 1 character and 1 character pointer

(you will need them)

Tasks:

  1. Compare 2 predefined strings, output whether they are same (0.25p)
  2. Ask the user for a string for concatenation (store in 1st buffer)
  3. Concatenate 1st buffer and 1st String (0.25p)
  4. Find the length of concatenated string (0.25p)
  5. Ask the user for a string (store in 2nd buffer)
    1. Display if that string is found in 1st Buffer. (0.25p)
  6. Ask the user for a character
    1. Remove all occurences of that character from a string (1st buffer) – write your own function! (0.5p)
  7. Find the length of the modified string – write your own function! (0.25p)
  8. Enter a string with spaces / use predefined string with spaces
    1. Split the string by words, print it out by separating them by vertical tabs \v (0.25p)

Up to 0.5p extra if you use pointer arithmetic in your functions!

One thought on “Lab 14 – 2017

Comments are closed.