Section C – analysing program segements1)struct dlink{int nodeid;struct dlink *next;struct dline *prev;} dlink_t;a pointer to the head of that linked list is maintained as a GLobal variable whose definition is dlink_t *head;the function remove_element(dlink_t*rp), needs to remove the node pointed to...
Section 2 – C programming1.Which of the following about the following two declarations is true i) int *f(); ii)int (*f)(); a)both are identical b)the first is a correct declaration and second is wrong c)the first declaration is a function returning a pointer to an integer and the second is a pointer...
Nay. I dont think it works that way. I really dont know what compiler you been using. But with VC++ it sure does throw some errors. I would post those errors.D:MSDev98MyProjectsapti_4apti_4.c(64) : e...
struct node{
char *word;
int count;
struct node *left;
struct node *right; };
Well machismo.Even this code is throwing me linker errors.Could you know why?
Hcl placement paper collection part I
· written testthe written test consists of 60 questions which are divided into 4 sections .The total duration of the test is 90 minutes. There is negative marking .The sectionwise distribution of the questions is as follows: section#1this section consisting of 15 questions is based on general computer...
thx
Shortest job first is theoretically the fastest algorithm, but in real world round robin is the best scheduling algorithm. Preemptive priority is a bit faster but it is also a bit costly to maintain few register for storing the information about unfinished processes.
b) Round-Robin
a) For synchronization
the ans is A preamble has data bits which are used for addressing as well as synchronization
What is the minimum depth of a tree with 18 nodes?A) 2b) 3c) 4
c)4
The answer is "a" because Queue follow FIFO Data Structure. Front---------A B C D E-----REAR &nbs...
ANS : 'd' due to insertion in a linklist we may insert after the rear node or bfore the front node that's why there is no change in the rear or front so alsowe see int the linklist the first node(rear) is fixed. and the last node set to be null.
hello frnds,
Ans---> C
Whenever there is delay b/w CPU and memory....thats why ans is C
bye dee...
Gold is added to the pn junction for?A)to increase hole-elec. Recombinationb)to reduce the same.
a) increase recombination
the answer is (b.).....coz the element gold has the highest density of all the elements...n hence more number of electrons n holes...so their will be increase in both electrons n holes...
1) identify the above circuit? A) d flip fop b) t flip-flop c) d latch d) multiplexer
Infosys placement paper: 11th september 2005,
1. A cube has its 6 faces painted red. It is cut by 6 straight lines into 27 smaller cubes. Find how many smaller cubes are there having: (i) 3 faces painted red. (ii) 2faces painted red. (iii) 1 face painted red. (iv) 0 faces painted red??? 2. There are two different temperature...
no . of cubes having 0 faces painted-----1
no of cubes having 1 face painted red ----6
no of cubes having 2 faces painted red-----12
no of cubes having 3 faces painted red-----8
YOu have a simple formula
n = we can write 27 as 3^3 3*3*3
n = 3
no of sides having zero color = (n-2)^3 = 1
no of sides having 1 color = (n-2)^2 * 6= 6
no if sides having 2 color = (n-2)*12 = 12
3 sides = 8
Run-time type information (RTTI) is a mechanism that allows the type of an object to be determined during program execution. RTTI was added to the C++ language because many vendors of class libraries ...
In case of Virtual function we are responsible for deciding the function at run time. Its our logic that reflects and no one does any thing.
Where as in case of RTTI TYPE is found of object. We dont do any thing for that. We simply use that.
Have you heard of "mutable" keyword?
The mutable storage class specifier is used only on a class data member to make it modifiable even though the member is part of an object declared as const.
You cannot use the mutable specifier with names declared as static or const, or reference members.
Answer are correct but not perfect.The Crux is:Purpose of 'mutable' is not changing some member's values of a const object at all. (Its a side bug which comes free with functionality.)You may use muta...
strstream is the class that specializes iostream to use a strstreambuf for input and output with arrays of characters in memory. You can create an strstream object by associating the object with a pre...
Class that reads and writes to an array in memory
By adding key word inline before the function name in the declaration, allows the function to be defined in the same file, in most case the header or the .h file without doing so in .cpp file.
Eg:-
inline LONG GetSeedValue(CEndUserRec* record)
{
return record->ENDUSERSID;
}
inline functions are the functions with the keyword inline written prior to their declaration in a class.it has the advantage that if a function is made inline than the code of the called function is ...
Can we generate a C++ source code from the binary file?
It is NOT possible!Binary file can be ONLY dissasembled to Assembler Source Code.C# CAN be decompiled and can give proper C# Source code, but this is because C# is more like interpreter and .NET ...
It is possible technically, because high level language codes converted into low
level, so there are some ways to converts this low level to high level..
For
Example
2 - 0000 0010
so it can be converted 0000 0010..
There
are some software which are used in private areas.
Explain "passing by value", "passing by pointer" and "passing by reference"
Pass By Value example:The function receives a copy of the variable. This local copy has scope, that is, exists only within the function. Any changes to the variable made in the function are not passed...
There is major defference between these three are when we want to avoid making the copy of variable and we want to change value of actual argument on calling function. there are we use passing by pointer,passing the reference. We can not perform arithmentic operation on reference.
How to write a program such that it will delete itself after execution?
The Richter method does delete the original file, but the temporary file remains behind. I compiled this as-is, and on Windows Server 2003, and 64 bit Windows 7, the temp file is not deleted. Presum...
if the solution is needed for the unix platform. Then you can create a pthread at the bottom of the program, take the current process id of the parent and make it a deamon by using the standard unix c...
Difference between "vector" and "array"?
Hi, for the above answer, i am little bit disagreeing, like VECTOR is UNIDIRECTIONAL ?? what does that mean ?? exactly, you mean to say that we cannot have multidimensional vectors ?? if that is ...
The main difference between vector and array is
Always vector is represented as uni-dimensional (ie., one dimensional) but whereas Array can be represented by both one-dimensional as well as two dimensional.
Thanks....
What are the types of stl containers?
Sequential containers-> vectors,Deque,list
Sequence containers and
Associative containers
Namespace is simply a declarative region.The purpose of namespace is to localize the names of identifiers to avoid name collisions ...
Namespace is a collection of Classes and the classes can be predefined or it can be use defined.we can also defined the Namespace.
Difference between a "assignment operator" and a "copy constructor"
Inspite of repeated requests by some (few) sensible people to everybody to read the question properly before responding, nobody listens.For doreen, the question does not ask you to explain deep copy a...
If a class contains members that are pointers initialized by new, then you should define a copy constructor that copies the pointed-to data instead of copying the pointers themselves. This is termed d...
Can we have "virtual constructors"?
we can have virtual destructor but we cant have virtual constructor.
Yes we cannot have virtual constructors. But if the need arises, we can simulate the implementation of virtural constructor by calling a Init method from the constructor which, should be a virtual function.
What are the different types of storage classes?
External,
Register,
Static,
Automatic
extern,auto,register,static.
What are virtual functions? How to implement virtual functions in "c"
Hi here i have more simplified example Hope this will give you clear view and check this linkhttp://www.codersource.net/published/view/325/virtual_functions_in.aspx#include <stdio.h>#include <...
Sukesh, Your response is essentially correct if we are talking about pure virtual functions. However, when we talk about virtual functions, then we perhaps need to make a distinction between regu...
What are the different types of polymorphism?
Types of Polymorphism:
1. Static / Compile time / Early binding polymorphism :
a. Function overloading
b. Operator overloading
2. Dynamic / Run time / Late binding:
a. Virtual function
There is only one type of polymorphism & that is run time polymorphism.
Refer advance text like Kathy Sierra books on Java & Grady Booch books on OOP's they explained why compile time polymorphism is not actually polymorphism
Explain the need for "virtual destructor".
Virtual destructor makes sure that all derived objects are deleted first before deleting the base class objects. When base class pointer assigned with Derived class objects, the virtual destructor of ...
Virtual destructor is used when deleting an object explicitly using the delete[] keyword. The Virtual destructor ensures that derived classes take on the implicit destructor method.
What is the difference between "overloading" and "overriding"?
Answered by: Richa
Answered On : Sep 28th, 2005Overloading a method (or function) in C++ is the ability for functions of the same name to be defined as long as these methods have different signatures (different set of parameters). Method overriding is the ability of the inherited class rewriting the virtual method of the base class.
All the above answers are right this is one more refinement.
overridding is runtime polymorphism while overloading is compile time polymorphism.
overloading: the same function can perform different operations.overridding: the derived class can rewrite the content of the base class.
Difference between "c structure" and "c++ structure".
No concept of encapsulation, code is different than the data in case of C structure. This is possible in C++ structure.
C does not have limitation access. Structures in C are used to regroup data from different types.
In C++ structure have limitation access propreties (private,public protected) with public access as default, can contain methods and can be used as a class.
What will happen if I say delete this
The danger only exists if you do a stack variable. There is no problem if you use a "new" ed object.
Memory corruption/exception. In case object is local(stack) this will corrupt the stack.
What is the output of printf ("%d")
it will take top element of stack which use for allocate memory for variables, so it ll print the value of last declared variable
it will print 0.
The doctor and nurse processed the delivery of child and not they are the father and mother of the child.
when the child was of 2yrs 3months and 8 dayz his father and mother died in the road accident ...after wich he was adopted by an engineer
that is an test tube baby
As 20 degree fahrenheit is definitely a freezing pt, at this time none can be be immersed so at 20 degree celsius the coin will immerse first
Give a situation were you can work as a team and alone?
anybody can give an answer on an example for this question please ?
at 13 hour
Question: Two persons were talking themselves with out knowing that that tower clock is set one hour back coz of the summer days.Person A; when shall we meet again?Person B: it takes 10 seconds for th...
300 chicken, 60 days they can feed
let x be total no of chicken and y be total no. of days that these chickens can be feed.then xy=(x-75)(y+20)=(x+100)(y-15)solve this you will get ans as 300 chicken and 60 days
hello
everybody
for me....d no of chickens are 770.
well for d detailed ans contact me on my id
A person is 80 years old in the year 490 and 70 years old in the year 500. Wat is his year of birth?
570 bc
perfect logicits BC so we are talking of era before 0000 (like minus year)not AC
5+5+5 , u have 2 make just a slight change and make it 550
put these two "+" on the right side five as +5+ and come close thes Pluse slowly so this figer convert in a rectangle which diveded by a horizotal line... and delet now this horizontal line automatic it will change in 550
remove + symbols and then subract 5 u get 550
FIRST KEEP 4 CIONS TO TOUCH EACHOTHER AND THEN THE 5th ON THEM AT CENTER
u first put 1 coin downthen put 3 coins on top of itthen put another coin over this
They gave me 6match sticks and asked 2 construct 6 equilateral triangles
Can you help me with the answer to this problem?
Arrange then in star formation...?
They asked me to prove half of 12 is 7
What is the answer?
roman numerals.xll<---- draw a line through the middle deviding 12(xll) in half =7(vll)
I think it is possible in the 3D dimension view
60-60=60 what can you derive from it?
RE: 60-60=60 what can you derive from it?
hey guys....i guess u guys know how shakuntala devi has proved 2=1in her book.now on similar lines........
a^2=b^2
a=+b or -b
a+b=0 a-b=0
take a=-b
a^2=-ab
a^2-b^2=-ab-b^2
(a+b)(a-b)=-b(a+b)
a-b=-b
a-b=a ; a=-b
a=b=60
so...60-60=60
Finally they said we will inform u through mail in 4 weeks whether you are seleclted or rejected
how was the day?Did you had a nice lunch?Tell us about your family backgroundHow can you maintain consistency in your academics?Did u learn anything New recently?Speak on any topic for 2 minutes (I ch...
these questions r good for anyone opting for infosys placements
hi,i want to know the place where HCL company is now going for recuitment.what is the crieteria for the company of B.TECH.
its good