Quantcast
Channel: GameDev.net
Viewing all articles
Browse latest Browse all 16874

how to return value from a function and exit it after that

$
0
0

I write a program to learn english with sdl2 and I want to return a vlue from a function in another function every function have separate window and I want to close window after return this value how ?

I can't do it it's very dificult please help.

this is the code of my function:

int Lrecord::select_mic(SDL_Event* le)

{

 

int index = 100;

mWindow = SDL_CreateWindow("select mic", SDL_WINDOWPOS_CENTERED, SDL_WINDOWPOS_CENTERED, 600, 400, SDL_WINDOW_SHOWN);

if (mWindow == NULL)

 printf("window error... %s", SDL_GetError());

SDL_Renderer *srender = SDL_CreateRenderer(mWindow, -1, SDL_RENDERER_ACCELERATED);

if (srender == NULL)

 printf("renderer error %s", SDL_GetError());

mWindowID = SDL_GetWindowID(mWindow);

tex1 …


Viewing all articles
Browse latest Browse all 16874

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>