wo_dbs
close
프로필 배경
프로필 로고

wo_dbs

  • 분류 전체보기 (295)
    • 프로젝트 (35)
      • Where42 (14)
      • kkrap (21)
    • 개발 지식 (106)
      • 인프라 (3)
      • GIt (1)
      • CS (5)
      • OS (5)
      • KSUG (40)
      • C++ (21)
      • Spring boot (5)
      • java (20)
      • Database && SQL (2)
      • Algorithm (4)
    • RFC (2)
      • OAuth 2.0 (2)
    • 객체지향 (24)
      • C++ 객체지향 (24)
    • 외부 활동 및 교육 (117)
      • 42Seoul (114)
      • 인턴 (3)
    • 나의 일기 및 회고록 (5)
      • 회고 (2)
      • 자격증 (3)
    • 기타 (3)
  • 홈
  • Github

[CPP Module 01] ex06

ex05에서 했던 함수 포인터 배열을 사용하는 것에서 switch문만 추가하면 된다. Harl.cpp#include "Harl.hpp"Harl::Harl() {}Harl::~Harl() {}void Harl::debug(void){ std::cout debug(); case 1: this->info(); case 2: this->warning(); case 3: this->error(); break ; default: std::cout

  • format_list_bulleted 외부 활동 및 교육/42Seoul
  • · 2023. 12. 2.
  • textsms

[CPP Module 01] ex05(함수 포인터 배열)

함수 포인터 배열함수 포인터 배열은 함수 포인터를 선언할 때 함수 포인터 이름 뒤에 [ ] 대괄호 안에 배열의 크기를 지정하면 된다반환값자료형 (*함수포인터 이름)[크기](매개변수자료형1, 매개변수자료형2);선언 예제int (*functionPointers[])(int, int) 전체 코드 예제#include // 덧셈 함수int add(int a, int b) { return a + b;}// 뺄셈 함수int subtract(int a, int b) { return a - b;}// 곱셈 함수int multiply(int a, int b) { return a * b;}int main() { // 함수 포인터 배열 선언 및 초기화 int (*functionPointers[])(..

  • format_list_bulleted 외부 활동 및 교육/42Seoul
  • · 2023. 12. 2.
  • textsms

[CPP Module 01] ex03

ex02에서 했던 레퍼런스와 포인터를 어디에서 쓸지 생각을 해보는 문제#include "HumanA.hpp"#include "HumanB.hpp"int main(){ { Weapon club = Weapon("crude spiked club"); HumanA bob("Bob", club); bob.attack(); club.setType("some other type of club"); bob.attack(); } { Weapon club = Weapon("crude spiked club"); HumanB jim("Jim"); jim.setWeapon(club); jim.attack(); club.setType("some other type of club"); jim.attack();..

  • format_list_bulleted 외부 활동 및 교육/42Seoul
  • · 2023. 12. 1.
  • textsms

[CPP Module 01] ex02

여기서 중요한 것은 포인터와 레퍼런스의 차이를 아는 것개념을 좀 더 알고 싶으면 나의 글 카테코리에 C++의 레퍼런스에 대한 개념을 보고 오자#include int main(void){ std::string str = "HI THIS IS BRAIN"; std::string *stringPTR = &str; std::string &stringREF = str; std::cout [C++] 포인터와 레퍼런스(참조)의 차이를 이해해보자 [C++] 포인터와 레퍼런스(참조)의 차이를 이해해보자C++에는 포인터(Pointer)와 레퍼런스(Reference)라는 개념이 있다. 포인터는 C 에도 있었던 개념이며 레퍼런스는 C++ 에서 등장한 개념이다. 언뜻 보면 용도가 비슷한데 정확히 어떤 차이점이 있는지,woo-..

  • format_list_bulleted 외부 활동 및 교육/42Seoul
  • · 2023. 12. 1.
  • textsms

[CPP Module 01] ex01(객체 포인터 배열 할당)

main.cpp#include "Zombie.hpp"int main(void){ Zombie *horde; horde = zombieHorde(5, "zombie"); if (!horde) return (0); for (int i = 0; i Zomebie.cpp#include "Zombie.hpp"Zombie::Zombie(){}Zombie::Zombie(std::string name) : name(name){}Zombie::~Zombie(){ std::cout name name name = name;} 객체 포인터 배열 할당을 해야되기 때문에 zomebieHorde를 만든다.#include "Zombie.hpp"Zombie* zombieHorde(int N, std::string name){ if..

  • format_list_bulleted 외부 활동 및 교육/42Seoul
  • · 2023. 12. 1.
  • textsms
  • navigate_before
  • 1
  • navigate_next
공지사항
전체 카테고리
  • 분류 전체보기 (295)
    • 프로젝트 (35)
      • Where42 (14)
      • kkrap (21)
    • 개발 지식 (106)
      • 인프라 (3)
      • GIt (1)
      • CS (5)
      • OS (5)
      • KSUG (40)
      • C++ (21)
      • Spring boot (5)
      • java (20)
      • Database && SQL (2)
      • Algorithm (4)
    • RFC (2)
      • OAuth 2.0 (2)
    • 객체지향 (24)
      • C++ 객체지향 (24)
    • 외부 활동 및 교육 (117)
      • 42Seoul (114)
      • 인턴 (3)
    • 나의 일기 및 회고록 (5)
      • 회고 (2)
      • 자격증 (3)
    • 기타 (3)
전체 방문자
오늘
어제
전체
인기 글
최근 글
최근 댓글
Copyright © 쭈미로운 생활 All rights reserved.
Designed by JJuum

티스토리툴바