--Originally published at Victor´s Spot
This task was very interesting and kind of hard but I believe I developed some habilities that will help me in my future, because my career requires having good knowledge and it is great to know and use these skills on my profesional life.
It consisted in “So for this assignment I would like to see you create a function that receives as parameter the name of a file (this would be a string value like data.txt) and your function counts the number of lines and the number of characters in the file which it returns as a single value (but with two values). You will want to look at how to create/define and return a struct value from a function and how to open and read text files line by line” (Bauer, 2017)
I believe I made used of these mastery topics, taken from kenscourses.com:
- Use of loops with “while” and “do while”
- Creation and use of strings
And now a little poem:
You can count a char
but you can not be a star
So you tried to be who you are
And succeed in life
You can download my code here: https://gist.github.com/victorcmadrigal/b2b3b3b74f01c37a05f1c1dbbe08edad