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

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

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

Prepare Interview

모의 시험

홈페이지로 설정

이 페이지 북마크

이메일 주소 구독

C++ 면접 질문과 답변

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

관련 차이점

C vs C++Java vs C++

Ques 56. How do you decide which integer type to use?


It depends on our requirement. When we are required an integer to be stored in 1 byte (means less than or equal to 255) we use short int, for 2 bytes we use int, for 8 bytes we use long int.

A char is for 1-byte integers, a short is for 2-byte integers, an int is generally a 2-byte or 4-byte integer (though not necessarily), a long is a 4-byte integer, and a long long is a 8-byte integer.

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

Ques 57. What does extern mean in a function declaration?

Using extern in a function declaration we can make a function such that it can used outside the file in which it is defined.

An extern variable, function definition, or declaration also makes the described variable or function usable by the succeeding part of the current source file. This declaration does not replace the definition. The declaration is used to describe the variable that is externally defined.

If a declaration for an identifier already exists at file scope, any extern declaration of the same identifier found within a block refers to that same object. If no other declaration for the identifier exists at file scope, the identifier has external linkage.

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

Ques 58. What can I safely assume about the initial values of variables which are not explicitly initialized?


It depends on complier which may assign any garbage value to a variable if it is not initialized.

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

Ques 59. What is the difference between char a[] = ?string?; and char *p = ?string?;?


In the first case 6 bytes are allocated to the variable a which is fixed, where as in the second case if *p is assigned to some other value the allocate memory can change.

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

Ques 60. What?s the auto keyword good for?


Answer1
Not much. It declares an object with automatic storage duration. Which means the object will be destroyed at the end of the objects scope. All variables in functions that are not declared as static and not dynamically allocated have automatic storage duration by default.

For example
int main()
{
int a; //this is the same as writing ?auto int a;?
}

Answer2
Local variables occur within a scope; they are ?local? to a function. They are often called automatic variables because they automatically come into being when the scope is entered and automatically go away when the scope closes. The keyword auto makes this explicit, but local variables default to auto auto auto auto so it is never necessary to declare something as an auto auto auto auto.

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

3) What can I safely assume about the initial values of variables which are not explicitly initialized? 4) What is the difference between char a[] = ?string?; and char *p = ?string?;? 5) What?s the auto keyword good for? " />

Most helpful rated by users:

Copyright © 2026, WithoutBook.