C语音面试题(英文版)_c语音面试题

2020-02-28 其他范文 下载本文

C语音面试题(英文版)由刀豆文库小编整理,希望给你工作、学习、生活带来方便,猜你可能喜欢“c语音面试题”。

C++ Interview Questions

Repeatedly asking C++ Interview Questions

1.What is public, protected, private?

Ans:

public, protected, private are acce specifiers that is used to implement encapsulation of data at various level.Private:

* Can be data or method members

* Are private to the cla where they are declared

* Acceible ONLY by the member methods of the cla where they are declared

* Only exception to the above rule is Friend(explanation of friends is beyond the scope of this topic

* In a C++ cla, private is default for member declaration.That is, if you do not specify any acce specifier(private, public, protected), the member is considered private

Public:

* Can be data or method members

* Are acceible by any function/method/application globally, so long as an instance of the cla where the public members are declared is created.* These members are acceible only thru an instance of the cla where they are declared * Generally used to define a C++ cla behaviour and/or to acce private data members(act as private data modifiers)

Protected

* Can be data or method members

* Act exactly as private members for all practical purposes, so long as they are referenced from within the cla(and/or instances of the cla)where they are declared

* Specifically used to define how certain data/method members of a cla would behave in a child cla(used to define their behaviour in inheritance)

* The protected members become private of a child cla in case of private inheritance, public

in case of public inheritance, and stay protected in case of protected inheritance.2.What is a cla?

Ans:

cla is a user defined data type,in which data members and member functions are defined.A cla can also be defined as a claification/category of objects that have similar

attributes and behaviour.For example, Automobile is a category of objects that have similar attributes, such as wheels, engine, doors, shape, color, cylinders etc., and behaviours,such as start, run, move, turn etc.Car is an instance of automobile which has different values for the attributes(4 wheels, one engine, 2 or 4 doors, 4/6/8 cylinders, etc),3.What is an object?

Ans:

In C++, Object is an instance of a Cla that has a runtime state, and is aociated with certain specific methods that can change its state.4.Difference between realloc()and free()?

Ans:

Realloc()is used to reallocate the memory for variable.Realloc()used to resize the memory held by the pointer to the number of bytes specificed.If the new

size is larger than current size, new memory is allocated.If it is le, the remaining(additional)bytes are released to general OS/application consumption.Free()is used to free the allocated memory of a variable.5.What is function overloading and operator overloading?

Ans:

Function overloading: C++ enables several functions of the same name to be defined, as long as these functions have different sets of parameters(at least as far as their types

are concerned).This capability is called function overloading.When an overloaded function is called, the C++ compiler selects the proper function by examining the number,types and order of the arguments in the call.Function overloading is commonly used to create several functions of the same name that perform similar tasks but on different data types For example, void Function_Test();

void Function_Test(int);// Overloaded

void Function_Test(int, int);// Overloaded

Operator overloading allows existing C++ operators to be redefined so that they work on objects of user-defined claes.Overloaded operators are syntactic sugar for equivalent function calls.They form a pleasant facade that doesn't add anything fundamental to the language(but they can improve understandability and reduce maintenance costs).6.What is virtual cla and friend cla?

Ans:

Virtual Base Cla: Used in context of multiple inheritance in C++.If you plan to derive two claes from a cla, and further derive one cla from the two claes in the second level, you need to declare the uppermost base cla as 'virtual' in the inherited claes.This prevents multiple copies of the uppermost base cla data members when an object of the cla at the third level of hierarchy is created.Friend cla: When a cla declares another cla as its friend, it is giving complete acce to all its data and methods including private and protected data and methods to the friend cla member methods.Friendship is not bi-directional.If A declares B as its friend it does NOT mean that A can acce private data of B.It only means that B can acce all data of A.7.What is abstraction?

Ans:

Abstraction refers to the act of representing eential features without including the

background details.That means abstraction is separating the logical properties from implementation details.For example driving the car is a logical property and design of the engine is the

implementation detail.8.What do you mean by inline function?

Ans:

The idea behind inline functions is to insert the code of a called function at the point where the function is called.If done carefully, this can improve the application's performance in exchange

for increased compile time and poibly(but not always)an increase in the size of the generated binary executables.When an inline Function is invoked the code of function is inserted instead of

jump to code of function.9.What do you mean by pure virtual functions?

Ans:

A pure virtual member function is a member function that the base cla forces derived claes to provide.Normally these member functions have no implementation.Pure virtual functions are equated to zero.cla Shape {

public:

virtual void draw()= 0;

};

10.What is virtual constructors/destructors?

Ans:

Virtual constructor: Constructors cannot be virtual.Declaring a constructor as a virtual function is a syntax error.Virtual destructors: If an object(with a non-virtual destructor)is destroyed explicitly by applying the delete operator to a base-cla pointer to the object,the base-cla destructor function(matching the pointer type)is called on the object.11.What is a scope resolution operator?

Ans:

A scope resolution operator(::)can be used to define the member functions of a cla outside the cla.Most generally a scope resolution operator is required when a data member is redefined by a derived cla,or an overriden method of the derived cla wants to call the base cla version of the same method.12.what is difference between constructor and destructor?

Ans:

Constructor is the memeber function of the cla which has the same name as that of cla and it is invoked whenever the cla object is instantiated.Using construtor we can allocate memory.Destructor is also the member function of same cla name and has ~ operator when ever declared in the function and it is used to destruct the object which has been

constructed ,whenever we want to destroy it..

外企英文面试题

面试官不仅关心你的学历,更关心你除所学之外是否有其他特长,这里的特长肯定是与该公司工作性质相关的特长啦。1.About your college and SpecialtyA: What university do you......

银监会英文面试题

1.Please describe yourself and how will you be fit for the new position?2.what do you know about CRBC?why do you want to be a banking regulator?3.Tell me the hard......

语音英文心得体会范文(17篇)

通过总结,我能更好地认识自己。在写心得体会时,可以适当引用相关的理论知识和实例进行阐释。接下来,小编将为大家分享一些关于心得体会的优秀范文,希望能够对大家有所帮助。语音......

语音英文心得体会(通用16篇)

写心得体会可以让我们更好地反思自己的成长和发展过程。在写心得体会时,可以向他人请教和交流,获取更多的反馈和建议。以下是一些经过编辑和整理的心得体会范文,供大家参考和借......

语音英文心得体会(优质16篇)

心得体会是我们对自己的成长和发展的思考和总结。心得体会的结尾要给人以启发和思考,具有一定的触动力。以下心得体会范文的作者们通过自身经验的总结,希望能给大家一些指导和......

《C语音面试题(英文版).docx》
将本文的Word文档下载,方便收藏和打印
推荐度:
C语音面试题(英文版)
点击下载文档
相关专题 c语音面试题 英文版 语音 面试题 c语音面试题 英文版 语音 面试题
[其他范文]相关推荐
[其他范文]热门文章
下载全文