人気の面接質問と回答・オンラインテスト
面接対策、オンラインテスト、チュートリアル、ライブ練習のための学習プラットフォーム

集中型学習パス、模擬テスト、面接向けコンテンツでスキルを伸ばしましょう。

WithoutBook は、分野別の面接質問、オンライン練習テスト、チュートリアル、比較ガイドをひとつのレスポンシブな学習空間にまとめています。

面接準備

模擬試験

ホームページに設定

このページをブックマーク

メールアドレスを登録

C++ 面接の質問と回答

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

関連する比較

C vs C++Java vs C++

質問 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.

役に立ちましたか? コメントを追加 コメントを見る
 

質問 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.

役に立ちましたか? コメントを追加 コメントを見る
 

質問 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.

役に立ちましたか? コメントを追加 コメントを見る
 

質問 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.

役に立ちましたか? コメントを追加 コメントを見る
 

質問 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.

役に立ちましたか? コメントを追加 コメントを見る
 

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? " />

ユーザー評価で最も役立つ内容:

著作権 © 2026、WithoutBook。