C Programming and Technical

How can I search for data in a linked list?
Unfortunately, the only way to search a linked list is with a linear search, because the only way
a linked list’s members can be accessed is sequentially.
Sometimes it is quicker to take the data from a linked list and store it in a different data
structure so that searches can be more efficient.

Read Solution (Total 0)

C Other Question

What is the purpose of main( ) function ?
The function main( ) invokes other functions within it.It is the first function to be called when the
program starts execution.
· It is the starting function
· It returns an int value to the environment that called the program
· Recursive call is allowed for main( ) also.
· It is a user-defined function
· Program execution ends when the closing brace of the function main( ) is reached.
· It has two arguments 1)argument count and 2) argument vector (represents strings passed).
· Any user-defined name can also be used as parameters for main( ) instead of argc and argv
main()
{
extern int i;
i=20;
printf("%d",i);
}
Answer: Linker Error : Undefined symbol '_i'
Explanation: extern storage class in the following declaration,
extern int i;
specifies to the compiler that the memory for i is allocated in some other program and that
address will be given to the current program at the time of linking. But linker finds that no other
variable of name i is available in any other program with memory space allocated for it. Hence a
linker error has occurred
find output