0

I'm currently trying to work with some image processing.

I'm using a function that streams the camera captions with an infinite while loop.

I just wanted to know, if it was possible to make the captions a return value of the function. I've tried to use "return" but it immediately kills the task.

In other words, make a function constantly have a return value by being called just once. Because I need the values of this loop for another task.

Thanks for your time, any reference would be of big help!

-Fernanda

  • 3
    Sounds like you need to use multiple threads. – john Apr 22 '20 at 07:50
  • Some languages have a feature like this. Sometimes refereed to as "yield" or "yield return". This question address how to obtain something similar in C++: https://stackoverflow.com/questions/7213839/equivalent-in-c-of-yield-in-c – Andreas Vinter-Hviid Apr 22 '20 at 07:54
  • If you are going for approach with threads this answer could help you: https://stackoverflow.com/questions/61275142/is-there-a-possibility-to-use-cin-parallel-to-cout/61287552#61287552 It's doesn't solve exactly your problem but it shows how to create threads and pass a reference between them. – Thomas Sablik Apr 22 '20 at 10:48

0 Answers0