main.cpp
 1  /* ************************************************************************** */
 2  /*                                                                            */
 3  /*                                                        :::      ::::::::   */
 4  /*   main.cpp                                           :+:      :+:    :+:   */
 5  /*                                                    +:+ +:+         +:+     */
 6  /*   By: gychoi <gychoi@student.42seoul.kr>         +#+  +:+       +#+        */
 7  /*                                                +#+#+#+#+#+   +#+           */
 8  /*   Created: 2023/07/24 20:24:22 by gychoi            #+#    #+#             */
 9  /*   Updated: 2023/07/25 17:06:13 by gychoi           ###   ########.fr       */
10  /*                                                                            */
11  /* ************************************************************************** */
12  
13  #include "Zombie.hpp"
14  
15  #ifdef LEAKS_CHECK
16  #include <cstdlib>
17  void	check_leaks(void)
18  {
19  	system("leaks --list -- zombie");
20  }
21  #define ATEXIT_CHECK() atexit(check_leaks)
22  #else
23  #define ATEXIT_CHECK()
24  #endif
25  
26  int	main(void)
27  {
28  	ATEXIT_CHECK();
29  	Zombie*	zombie = newZombie("HeapZombie");
30  
31  	zombie->announce();
32  	randomChump("StackZombie");
33  	delete zombie;
34  	return (0);
35  }