-
Notifications
You must be signed in to change notification settings - Fork 0
/
c++.html
739 lines (650 loc) · 39.3 KB
/
c++.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Get FAQ</title>
<link rel="stylesheet" href="style.css">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.3/css/all.min.css">
<link rel="stylesheet"
href="https://fonts.googleapis.com/css2?family=Poppins:wght@100;200;300;400;600;700&display=swap">
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css" integrity="sha384-Gn5384xqQ1aoWXA+058RXPxPg6fy4IWvTNh0E263XmFcJlSAwiGgFAW/dAiS6JXm" crossorigin="anonymous">
</head>
<body>
<section class="Sub-header">
<nav class="navbar navbar-expand-lg navbar-light">
<div class="container">
<a href="index.html" class="logo">
<img src="img/logo.svg" alt="logo" />
</a>
<button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarSupportedContent" aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>
<div class="nav-links" id="navLinks">
<ul>
<li><a href="index.html" class="btn btn btn-secondary ">Home</a></li>
<li>
<div class="dropdown">
<button class="btn btn-secondary dropdown-toggle btn" type="button" id="dropdownMenuButton" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
LANGUAGES
</button>
<div class="dropdown-menu" aria-labelledby="dropdownMenuButton">
<a class="dropdown-item" href="python.html">Python</a>
<a class="dropdown-item" href="c++.html">C++</a>
<a class="dropdown-item" href="java.html">Java</a>
<a class="dropdown-item" href="javascript.html">Data Structure</a>
<a class="dropdown-item" href="OS.html">Operating System</a>
<a class="dropdown-item" href="sql.html">SQL</a>
</div>
</div>
</li>
<li><a href="about copy.html" class="btn btn btn-secondary ">About Us</a></li>
<li><a href="contact.html" class="btn btn btn-secondary ">Contact Us</a></li>
</ul>
</div>
</div>
</nav>
<div class="inner_text">
<h1>C++</h1>
</div>
</section>
<!-- course start -->
<section class="course">
<h1>QUESTIONS BASED ON C++ LANGUAGE</h1>
<div class= "faq">
<div class = "question">
<h4>Define inline function</h4>
<svg width="15" height="10" viewbox = "0 0 42 25">
<path d="M3 3L21 21L39 3" stroke="white" stroke-width="7" stroke-linecap="round"/>
</svg>
</div>
<div class = "answer">
<p>
If a function is inline, the compiler places a copy of the code of that function at each point where the function is called at compile time. One of the important advantages of using an inline function is that it eliminates the function calling overhead of a traditional function.
</p>
</div>
</div>
<div class= "faq">
<div class = "question">
<h4>What do you mean by abstraction in C++?</h4>
<svg width="15" height="10" viewbox = "0 0 42 25">
<path d="M3 3L21 21L39 3" stroke="white" stroke-width="7" stroke-linecap="round"/>
</svg>
</div>
<div class = "answer">
<p>
Abstraction is the process of showing the essential details to the user and hiding the details which we don’t want to show to the user or hiding the details which are irrelevant to a particular user.
</p>
</div>
</div>
<div class= "faq">
<div class = "question">
<h4>Is deconstructor overloading possible? If yes then explain and if no then why?</h4>
<svg width="15" height="10" viewbox = "0 0 42 25">
<path d="M3 3L21 21L39 3" stroke="white" stroke-width="7" stroke-linecap="round"/>
</svg>
</div>
<div class = "answer">
<p>
No destructor overloading is not possible. Destructors take no arguments, so there’s only one way to destroy an object. That’s the reason destructor overloading is not possible.
</p>
</div>
</div>
<div class= "faq">
<div class = "question">
<h4>What do you mean by call by value and call by reference?</h4>
<svg width="15" height="10" viewbox = "0 0 42 25">
<path d="M3 3L21 21L39 3" stroke="white" stroke-width="7" stroke-linecap="round"/>
</svg>
</div>
<div class = "answer">
<p>
In call by value method, we pass a copy of the parameter is passed to the functions. For these copied values a new memory is assigned and changes made to these values do not reflect the variable in the main function.
<br>In call by reference method, we pass the address of the variable and the address is used to access the actual argument used in the function call. So changes made in the parameter alter the passing argument.
</p>
</div>
</div>
<div class= "faq">
<div class = "question">
<h4>What is an abstract class and when do you use it?</h4>
<svg width="15" height="10" viewbox = "0 0 42 25">
<path d="M3 3L21 21L39 3" stroke="white" stroke-width="7" stroke-linecap="round"/>
</svg>
</div>
<div class = "answer">
<p>
A class is called an abstract class whose objects can never be created. Such a class exists as a parent for the derived classes. We can make a class abstract by placing a pure virtual function in the class.
</p>
</div>
</div>
<div class= "faq">
<div class = "question">
<h4>Which programming language's unsatisfactory performance led to the discovery of C++? </h4>
<svg width="15" height="10" viewbox = "0 0 42 25">
<path d="M3 3L21 21L39 3" stroke="white" stroke-width="7" stroke-linecap="round"/>
</svg>
</div>
<div class = "answer">
<p>
C++ was discovered in order to cope with the disadvantages of C.
</p>
</div>
</div>
<div class= "faq">
<div class = "question">
<h4>How delete [] is different from delete?</h4>
<svg width="15" height="10" viewbox = "0 0 42 25">
<path d="M3 3L21 21L39 3" stroke="white" stroke-width="7" stroke-linecap="round"/>
</svg>
</div>
<div class = "answer">
<p>
Delete is used to release a unit of memory, delete[] is used to release an array.
</p>
</div>
</div>
<div class= "faq">
<div class = "question">
<h4>What is an object?</h4>
<svg width="15" height="10" viewbox = "0 0 42 25">
<path d="M3 3L21 21L39 3" stroke="white" stroke-width="7" stroke-linecap="round"/>
</svg>
</div>
<div class = "answer">
<p>
The Object is the instance of a class. A class provides a blueprint for objects. So you can create an object from a class. The objects of a class are declared with the same sort of declaration that we declare variables of basic types.
</p>
</div>
</div>
<div class= "faq">
<div class = "question">
<h4>What is the difference between new() and malloc()? </h4>
<svg width="15" height="10" viewbox = "0 0 42 25">
<path d="M3 3L21 21L39 3" stroke="white" stroke-width="7" stroke-linecap="round"/>
</svg>
</div>
<div class = "answer">
<p>
new() is a preprocessor while malloc() is a function.
There is no need to allocate the memory while using "new" but in malloc() you have to use sizeof().
"new" initializes the new memory to 0 while malloc() gives random value in the newly allotted memory location.
The new() operator allocates the memory and calls the constructor for the object initialization and malloc() function allocates the memory but does not call the constructor for the object initialization.
The new() operator is faster than the malloc() function as operator is faster than the function.
</p>
</div>
</div>
<div class= "faq">
<div class = "question">
<h4>What are the methods of exporting a function from a DLL?</h4>
<svg width="15" height="10" viewbox = "0 0 42 25">
<path d="M3 3L21 21L39 3" stroke="white" stroke-width="7" stroke-linecap="round"/>
</svg>
</div>
<div class = "answer">
<p>
There are two ways:
<br>• By using the DLL's type library.
<br>• Taking a reference to the function from the DLL instance.
</p>
</div>
</div>
<div class= "faq">
<div class = "question">
<h4> What is a Class?</h4>
<svg width="15" height="10" viewbox = "0 0 42 25">
<path d="M3 3L21 21L39 3" stroke="white" stroke-width="7" stroke-linecap="round"/>
</svg>
</div>
<div class = "answer">
<p>
Class is a user-defined data type in C++. It can be created to solve a particular kind of problem. After creation, the user is not required to know the details of the working of a class.
In general, class acts as a blueprint of a project and can include in various parameters and functions or actions operating on these parameters. These are called the members of the class.
</p>
</div>
</div>
<div class= "faq">
<div class = "question">
<h4>What is the use of ‘using’ declaration?</h4>
<svg width="15" height="10" viewbox = "0 0 42 25">
<path d="M3 3L21 21L39 3" stroke="white" stroke-width="7" stroke-linecap="round"/>
</svg>
</div>
<div class = "answer">
<p>
Using Declaration is used to refer a name from the namespace without the scope resolution operator.
</p>
</div>
</div>
<div class= "faq">
<div class = "question">
<h4>What is the difference between an Object and a Class?</h4>
<svg width="15" height="10" viewbox = "0 0 42 25">
<path d="M3 3L21 21L39 3" stroke="white" stroke-width="7" stroke-linecap="round"/>
</svg>
</div>
<div class = "answer">
<p>
Class is a blueprint of a project or problem to be solved and consists of variables and methods. These are called the members of the class. We cannot access methods or variables of the class on its own unless they are declared static.
In order to access the class members and put them to use, we should create an instance of a class which is called an Object. The class has an unlimited lifetime whereas an object has a limited lifespan only.
</p>
</div>
</div>
<div class= "faq">
<div class = "question">
<h4>What is an Explicit Constructor?</h4>
<svg width="15" height="10" viewbox = "0 0 42 25">
<path d="M3 3L21 21L39 3" stroke="white" stroke-width="7" stroke-linecap="round"/>
</svg>
</div>
<div class = "answer">
<p>
A conversion constructor is declared with the explicit keyword. The compiler does not use an explicit constructor to implement an implied conversion of types. Its purpose is reserved explicitly for construction.
</p>
</div>
</div>
<div class= "faq">
<div class = "question">
<h4>What is the role of the Static keyword for a class member variable?</h4>
<svg width="15" height="10" viewbox = "0 0 42 25">
<path d="M3 3L21 21L39 3" stroke="white" stroke-width="7" stroke-linecap="round"/>
</svg>
</div>
<div class = "answer">
<p>
The static member variable shares a common memory across all the objects created for the respective class. We need not refer to the static member variable using an object. However, it can be accessed using the class name itself.
</p>
</div>
</div>
<div class= "faq">
<div class = "question">
<h4>Explain the Static Member Function</h4>
<svg width="15" height="10" viewbox = "0 0 42 25">
<path d="M3 3L21 21L39 3" stroke="white" stroke-width="7" stroke-linecap="round"/>
</svg>
</div>
<div class = "answer">
<p>
A static member function can access only the static member variable of the class. Same as the static member variables, a static member function can also be accessed using the class name.
</p>
</div>
</div>
<div class= "faq">
<div class = "question">
<h4>Explain Register Storage Specifier.</h4>
<svg width="15" height="10" viewbox = "0 0 42 25">
<path d="M3 3L21 21L39 3" stroke="white" stroke-width="7" stroke-linecap="round"/>
</svg>
</div>
<div class = "answer">
<p>
“Register” variable should be used whenever the variable is used. When a variable is declared with a “register” specifier, then the compiler gives CPU register for its storage to speed up the lookup of the variable.
</p>
</div>
</div>
<div class= "faq">
<div class = "question">
<h4>State the difference between delete and delete[].</h4>
<svg width="15" height="10" viewbox = "0 0 42 25">
<path d="M3 3L21 21L39 3" stroke="white" stroke-width="7" stroke-linecap="round"/>
</svg>
</div>
<div class = "answer">
<p>
“delete[]” is used to release the memory allocated to an array which was allocated using new[].
<br> “delete” is used to release one chunk of memory which was allocated using new.
</p>
</div>
</div>
<div class= "faq">
<div class = "question">
<h4>What is an Inline function in C++?</h4>
<svg width="15" height="10" viewbox = "0 0 42 25">
<path d="M3 3L21 21L39 3" stroke="white" stroke-width="7" stroke-linecap="round"/>
</svg>
</div>
<div class = "answer">
<p>
Inline function is a function that is compiled by the compiler as the point of calling the function and the code is substituted at that point. This makes compiling faster. This function is defined by prefixing the function prototype with the keyword “inline”.
<br>Such functions are advantageous only when the code of the inline function is small and simple. Although a function is defined as Inline, it is completely compiler dependent to evaluate it as inline or not.
</p>
</div>
</div>
<div class= "faq">
<div class = "question">
<h4>What is the difference between equal to (==) and Assignment Operator (=)?</h4>
<svg width="15" height="10" viewbox = "0 0 42 25">
<path d="M3 3L21 21L39 3" stroke="white" stroke-width="7" stroke-linecap="round"/>
</svg>
</div>
<div class = "answer">
<p>
In C++, equal to (==) and assignment operator (=) are two completely different operators.
Equal to (==) is an equality relational operator that evaluates two expressions to see if they are equal and returns true if they are equal and false if they are not.
<br>The assignment operator (=) is used to assign a value to a variable. Hence, we can have a complex assignment operation inside the equality relational operator for evaluation.
</p>
</div>
</div>
<div class= "faq">
<div class = "question">
<h4>What is a mutable storage class specifier? How can they be used?</h4>
<svg width="15" height="10" viewbox = "0 0 42 25">
<path d="M3 3L21 21L39 3" stroke="white" stroke-width="7" stroke-linecap="round"/>
</svg>
</div>
<div class = "answer">
<p>
A mutable storage class specifier is applied only on the class's non-static and non-constant member variable. It is used for altering the constant class object's member by declaring it. This can be done by using a storage class specifier.
</p>
</div>
</div>
<div class= "faq">
<div class = "question">
<h4>Can we have a String primitive data type in C++?</h4>
<svg width="15" height="10" viewbox = "0 0 42 25">
<path d="M3 3L21 21L39 3" stroke="white" stroke-width="7" stroke-linecap="round"/>
</svg>
</div>
<div class = "answer">
<p>
No, we cannot have a String Primitive data type in C++. Instead, we can have a class from the Standard Template Library (STL).
</p>
</div>
</div>
<div class= "faq">
<div class = "question">
<h4>Can we use access specifiers to achieve data hiding in C++?</h4>
<svg width="15" height="10" viewbox = "0 0 42 25">
<path d="M3 3L21 21L39 3" stroke="white" stroke-width="7" stroke-linecap="round"/>
</svg>
</div>
<div class = "answer">
<p>
Yes, we can use access specifiers to achieve data hiding in C++. These include Private and Protected.
</p>
</div>
</div>
<div class= "faq">
<div class = "question">
<h4>Define Block scope variable?</h4>
<svg width="15" height="10" viewbox = "0 0 42 25">
<path d="M3 3L21 21L39 3" stroke="white" stroke-width="7" stroke-linecap="round"/>
</svg>
</div>
<div class = "answer">
<p>
A Block scope variable is the one that is specified as a block using the C++ that can be declared anywhere within the block.
</p>
</div>
</div>
<div class= "faq">
<div class = "question">
<h4>What is the function of the keyword "Auto"?</h4>
<svg width="15" height="10" viewbox = "0 0 42 25">
<path d="M3 3L21 21L39 3" stroke="white" stroke-width="7" stroke-linecap="round"/>
</svg>
</div>
<div class = "answer">
<p>
The keyword “Auto” is used by default for various local variables to make function work automatically.
</p>
</div>
</div>
<div class= "faq">
<div class = "question">
<h4>Is there any advantage of using one over the other?</h4>
<svg width="15" height="10" viewbox = "0 0 42 25">
<path d="M3 3L21 21L39 3" stroke="white" stroke-width="7" stroke-linecap="round"/>
</svg>
</div>
<div class = "answer">
<p>
Though both codes will generate the same output, sample code 2 is a more performant option. This is due to the fact that the post-increment ‘itr++’ operator is more expensive than the pre-increment ‘++itr’ operator.
The post-increment operator generates a copy of the element before proceeding with incrementing the element and returning the copy. Moreover, most compilers will automatically optimize sample code 1 by converting it implicitly into sample code 2.
</p>
</div>
</div>
<div class= "faq">
<div class = "question">
<h4> Is it possible for a C++ program to be compiled without the main() function?</h4>
<svg width="15" height="10" viewbox = "0 0 42 25">
<path d="M3 3L21 21L39 3" stroke="white" stroke-width="7" stroke-linecap="round"/>
</svg>
</div>
<div class = "answer">
<p>
Yes, it is possible. However, as the main() function is essential for the execution of the program, the program will stop after compiling and will not execute.
</p>
</div>
</div>
<div class= "faq">
<div class = "question">
<h4>How is function overloading different from operator overloading?</h4>
<svg width="15" height="10" viewbox = "0 0 42 25">
<path d="M3 3L21 21L39 3" stroke="white" stroke-width="7" stroke-linecap="round"/>
</svg>
</div>
<div class = "answer">
<p>
Function overloading allows two or more functions with different type and number of parameters to have the same name. On the other hand, operator overloading allows for redefining the way an operator works for user-defined types.
</p>
</div>
</div>
<div class= "faq">
<div class = "question">
<h4>Explain ‘this’ pointer?</h4>
<svg width="15" height="10" viewbox = "0 0 42 25">
<path d="M3 3L21 21L39 3" stroke="white" stroke-width="7" stroke-linecap="round"/>
</svg>
</div>
<div class = "answer">
<p>
The ‘this’ pointer is a constant pointer, and it holds the memory address of the current object. It passes as a hidden argument to all the nonstatic member function calls. Also, it is available as a local variable within the body of all the nonstatic functions.
As static member functions can be called even without any object, i.e., with the class name, the ‘this’ pointer is not available for them.
</p>
</div>
</div>
<div class= "faq">
<div class = "question">
<h4>Can we have a recursive inline function in C++?</h4>
<svg width="15" height="10" viewbox = "0 0 42 25">
<path d="M3 3L21 21L39 3" stroke="white" stroke-width="7" stroke-linecap="round"/>
</svg>
</div>
<div class = "answer">
<p>
Even though it is possible to call an inline function from within itself in C++, the compiler may not generate the inline code. This is so because the compiler won’t determine the depth of the recursion at the compile time.
Nonetheless, a compiler with a good optimizer is able to inline recursive calls until some depth is fixed at compile-time and insert non-recursive calls at compile time for the cases when the actual depth exceeds run time.
</p>
</div>
</div>
<div class= "faq">
<div class = "question">
<h4>What is the function of the keyword “Volatile”?</h4>
<svg width="15" height="10" viewbox = "0 0 42 25">
<path d="M3 3L21 21L39 3" stroke="white" stroke-width="7" stroke-linecap="round"/>
</svg>
</div>
<div class = "answer">
<p>
"Volatile" is a function that helps in declaring that the particular variable is volatile and thereby directs the compiler to change the variable externally- this way, the compiler optimization on the variable reference can be avoided.
</p>
</div>
</div>
<div class= "faq">
<div class = "question">
<h4>Comment on Assignment Operator in C++.</h4>
<svg width="15" height="10" viewbox = "0 0 42 25">
<path d="M3 3L21 21L39 3" stroke="white" stroke-width="7" stroke-linecap="round"/>
</svg>
</div>
<div class = "answer">
<p>
Assignment operator in C++ is used to assign a value to another variable.
a = 5;
This line of code assigns the integer value 5 to variable a.
The part at the left of the =operator is known as an lvalue (left value) and the right as rvalue (right value). Lvalue must always be a variable whereas the right side can be a constant, a variable, the result of an operation or any combination of them.
The assignment operation always takes place from the right to left and never at the inverse.
One property which C++ has over the other programming languages is that the assignment operator can be used as the rvalue (or part of an rvalue) for another assignment.
</p>
</div>
</div>
<div class= "faq">
<div class = "question">
<h4>What is Abstraction?</h4>
<svg width="15" height="10" viewbox = "0 0 42 25">
<path d="M3 3L21 21L39 3" stroke="white" stroke-width="7" stroke-linecap="round"/>
</svg>
</div>
<div class = "answer">
<p>
Abstraction can be defined as a technique in which you only show functionality to the user i.e., the details that you want the user to see, hiding the internal details or implementation details.
</p>
</div>
</div>
<div class= "faq">
<div class = "question">
<h4>What is STL?</h4>
<svg width="15" height="10" viewbox = "0 0 42 25">
<path d="M3 3L21 21L39 3" stroke="white" stroke-width="7" stroke-linecap="round"/>
</svg>
</div>
<div class = "answer">
<p>
STL stands for standard template library. It is a library of container templates that provide generic classes and functions.
</p>
</div>
</div>
<div class= "faq">
<div class = "question">
<h4>What is a friend function?</h4>
<svg width="15" height="10" viewbox = "0 0 42 25">
<path d="M3 3L21 21L39 3" stroke="white" stroke-width="7" stroke-linecap="round"/>
</svg>
</div>
<div class = "answer">
<p>
You can define a friend function as a function that can access private, public and protect members of the class. You declare the friend function with the help of the friend keyword. You declare this function inside the class.
</p>
</div>
</div>
<div class= "faq">
<div class = "question">
<h4>What is call by value and call by reference in C++?</h4>
<svg width="15" height="10" viewbox = "0 0 42 25">
<path d="M3 3L21 21L39 3" stroke="white" stroke-width="7" stroke-linecap="round"/>
</svg>
</div>
<div class = "answer">
<p>
In the call by value method, you pass the copies of actual parameters to the function's formal parameters. This means if there is any change in the values inside the function, then that change will not affect the actual values.
In the call-by-reference method, the reference or address of actual parameters is sent to the function's formal parameters. This means any change in values inside the function will be reflected in the actual values.
</p>
</div>
</div>
<div class= "faq">
<div class = "question">
<h4>When is void() return type used?</h4>
<svg width="15" height="10" viewbox = "0 0 42 25">
<path d="M3 3L21 21L39 3" stroke="white" stroke-width="7" stroke-linecap="round"/>
</svg>
</div>
<div class = "answer">
<p>
You use the void() return type when you don’t want to return any value. It specifies that the function doesn’t return a value. A function with a void return type completes its task and then returns the control to the caller.
</p>
</div>
</div>
<div class= "faq">
<div class = "question">
<h4> Can you compile a program without the main function?</h4>
<svg width="15" height="10" viewbox = "0 0 42 25">
<path d="M3 3L21 21L39 3" stroke="white" stroke-width="7" stroke-linecap="round"/>
</svg>
</div>
<div class = "answer">
<p>
Yes, you can compile a program without the main function, but you cannot run or execute the program because the main() function is the entry point, from where all the execution begins. And without the entry point, then you can execute the program.
</p>
</div>
</div>
<div class= "faq">
<div class = "question">
<h4>Discuss the difference between prefix and postfix?</h4>
<svg width="15" height="10" viewbox = "0 0 42 25">
<path d="M3 3L21 21L39 3" stroke="white" stroke-width="7" stroke-linecap="round"/>
</svg>
</div>
<div class = "answer">
<p>
In prefix (++i), first, it increments the value, and then it assigns the value to the expression.
<br> In postfix (i++), it assigns the value to the expression, and then it increments the variable's value.
</p>
</div>
</div>
<div class= "faq">
<div class = "question">
<h4>What is a class template?</h4>
<svg width="15" height="10" viewbox = "0 0 42 25">
<path d="M3 3L21 21L39 3" stroke="white" stroke-width="7" stroke-linecap="round"/>
</svg>
</div>
<div class = "answer">
<p>
A class template is used to create a family of classes and functions. For example, we can create a template of an array class which will enable us to create an array of various types such as int, float, char, etc.
<br> Similarly, we can create a template for a function, suppose we have a function add(), then we can create multiple versions of add().
</p>
</div>
</div>
</section>
<!-- course end -->
<!-- best course start -->
<section class="facilities">
<h1>Top 5 Things to Remember in an Interview</h1>
<p>You worked hard on your resume and job application, and now you are called in for an in-person job interview. You are one step closer to your dream job.
It’s time to understand how to succeed in the job interview, so that you can actually land the job. Here are the most important things you have to remember.</p>
<div class="row">
<div class="faq">
<h1>1. Dress appropriately</h1>
<h6>Plan out an outfit that fits the culture of the company you are applying for. If the company does not have a dress code, it’s a good idea to wear business casual.
Leave your shorts and tank top at home, and put on a shirt and a pair of long pants. It’s always better to be overdressed than under. Try on your outfit before the interview to make sure that it fits and looks smart.
</h6>
<h1>2. Arrive on time </h1>
<h6>Don’t ever arrive at a job interview late! It’s best to arrive 15 minutes before the scheduled time in case you have to fill in some paperwork. This also allows you to settle down and check out the dynamics of the office.
If you are not familiar with the area in which the company is located, do a test run a week or two before to make sure that you won’t get lost. If you are driving, make a note on where you can park your car.
</h6>
<h1>3. Mind your manner</h1>
<h6>Be polite and greet everyone you meet, including people you meet in the elevator. When you enter the interview, offer the interviewer a warm greeting. These first few seconds can make or break your interview. At the end of the interview, don’t forget to thank the interviewer for giving you the opportunity for the meeting. When you leave the company, say goodbye to the receptionist.
</h6>
<h1>4. Pay attention to your body language<h1>
<h6> Poor body language, such as playing with a pen, chewing gum, slouching, and even brushing back hair, can be a distraction. If you notice you have a tendency to do any of these, train yourself to avoid these bad habits. You can replace them with positive body language that include nodding, eye contact, smiling, and solid posture.
</h6>
<h1>5. Ask insightful questions</h1>
<h6>Most interviewers end an interview by allowing the candidate to ask questions. Regardless of how well you know the company and how thorough the interviewer in telling you about the job, you must ask a few questions. The more insightful your questions are, the more you will impress your interviewer.
What do you do in an interview? Let us know in the comments below!
</h6>
</div>
</div>
<!-- Footer start -->
<section class="footer">
<hr>
<a href="about copy.html" class="foot_btn">ABOUT US</a>
<a href="contact.html" class="foot_btn">CONTACT US</a>
<div class="icons">
<i class="fab fa-facebook-f"></i>
<i class="fab fa-instagram"></i>
<i class="fab fa-twitter"></i>
<i class="fab fa-linkedin"></i>
</div>
<p>Made with <i class="fas fa-heart"></i> by Shruti </p>
<p>Copyright © 2022 <a href="index.html">Get FAQ</a>. All Rights Reserved.</p>
</section>
<!-- Footer end -->
<script src="script.js"></script>
<script src="https://code.jquery.com/jquery-3.2.1.slim.min.js" integrity="sha384-KJ3o2DKtIkvYIK3UENzmM7KCkRr/rE9/Qpg6aAZGJwFDMVNA/GpGFF93hXpG5KkN" crossorigin="anonymous"></script>
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/umd/popper.min.js" integrity="sha384-ApNbgh9B+Y1QKtv3Rn7W3mgPxhU9K/ScQsAP7hUibX39j7fakFPskvXusvfa0b4Q" crossorigin="anonymous"></script>
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/js/bootstrap.min.js" integrity="sha384-JZR6Spejh4U02d8jOt6vLEHfe/JQGiRRSQQxSfFWpi1MquVdAyjUar5+76PVCmYl" crossorigin="anonymous"></script>
<script type="module" src="https://unpkg.com/[email protected]/dist/ionicons/ionicons.esm.js"></script>
<script nomodule src="https://unpkg.com/[email protected]/dist/ionicons/ionicons.js"></script>
</body>
</html>