Lesson 5: Arrays, Strings, and Pointers | Haiku Project

It’s that time again, continuing in the journey from No Code to Know Code. This lesson marks the end of the first unit and is somewhere around halfway from complete neophyte to writing – and understanding – our first program for Haiku which uses windows and buttons. Learning to Program with Haiku, Lesson 5.


This is a companion discussion topic for the original entry at https://www.haiku-os.org/blog/darkwyrm/2010-02-13_lesson_5_arrays_strings_and_pointers/

Hello,
The function gets has been deprecated in C++14: std::gets - cppreference.com

2 Likes

You are responding to a blogpost from 2010.

Edit: also, where did you even see the usage of gets? The link in the post seems down…

1 Like

This is where I am coming from: Learning to Program with Haiku | Haiku Project Lesson 5

1 Like

It was deprecated even earlier, in C++11. In C++14 it has been completely removed.

There is a slightly updated version of these lessons available: GitHub - theclue/programming-with-haiku: Learning to program with Haiku and Programming with Haiku books, but it has the same problem.

So we should fix that one, and update the website to point to it :slight_smile:

4 Likes

I prepared the update here:

If that looks correct, I will integrate it and see if @TheClue is still around to make a new release of the book, or if we should move that responsibilty to someone else :slight_smile:

“Both take a char pointer as the only parameter.” - It looks like that bit needs to change since fgets takes multiple parameters.

Thanks for the proofreading, I fixed that :slight_smile: