가장 많이 묻는 면접 질문과 답변 & 온라인 테스트
면접 준비, 온라인 테스트, 튜토리얼, 라이브 연습을 위한 학습 플랫폼

집중 학습 경로, 모의고사, 면접 준비 콘텐츠로 실력을 키우세요.

WithoutBook은 주제별 면접 질문, 온라인 연습 테스트, 튜토리얼, 비교 가이드를 하나의 반응형 학습 공간으로 제공합니다.

Prepare Interview

모의 시험

홈페이지로 설정

이 페이지 북마크

이메일 주소 구독

C++ 면접 질문과 답변

Test your skills through the online practice test: C++ Quiz Online Practice Test

관련 차이점

C vs C++Java vs C++

Ques 51. Explain which of the following declarations will compile and what will be constant - a pointer or the value pointed at: * const char *
* char const *
* char * const

Note: Ask the candidate whether the first declaration is pointing to a string or a single character. Both explanations are correct, but if he says that it?s a single character pointer, ask why a whole string is initialized as char* in C++. If he says this is a string declaration, ask him to declare a pointer to a single character. Competent candidates should not have problems pointing out why const char* can be both a character and a string declaration, incompetent ones will come up with invalid reasons.

도움이 되었나요? Add Comment View Comments
 

Ques 52. You?re given a simple code for the class Bank Customer. Write the following functions:
* Copy constructor
* = operator overload
* == operator overload
* + operator overload (customers? balances should be added up, as an example of joint account between husband and wife)

Note:Anyone confusing assignment and equality operators should be dismissed from the interview. The applicant might make a mistake of passing by value, not by reference. The candidate might also want to return a pointer, not a new object, from the addition operator. Slightly hint that you?d like the value to be changed outside the function, too, in the first case. Ask him whether the statement customer3 = customer1 + customer2 would work in the second case.

도움이 되었나요? Add Comment View Comments
 

Ques 53. What problems might the following macro bring to the application?


#define sq(x) x*x

도움이 되었나요? Add Comment View Comments
 

Ques 54. Anything wrong with this code?


T *p = new T[10];
delete p;


Everything is correct, Only the first element of the array will be deleted?, The entire array will be deleted, but only the first element destructor will be called.

도움이 되었나요? Add Comment View Comments
 

Ques 55. Anything wrong with this code?
T *p = 0;
delete p;

Yes, the program will crash in an attempt to delete a null pointer.

도움이 되었나요? Add Comment View Comments
 

* char const *
* char * const 2) You?re given a simple code for the class Bank Customer. Write the following functions:
* Copy constructor
* = operator overload
* == operator overload
* + operator overload (customers? balances should be added up, as an example of joint account between husband and wife) 3) What problems might the following macro bring to the application? 4) Anything wrong with this code? 5) Anything wrong with this code?
T *p = 0;
delete p; " />

Most helpful rated by users:

Copyright © 2026, WithoutBook.