Technical Questions

Q:

Undefined reference to 'pthread_create'

How to Fix this error?

Answer

This is a common error while compiling C program in Linux. This error occurs when you are using pthread_create function to create threads in your programs.


To fix this problem ensure following points:
Include header file pthread.h in your program.
Add –lpthread linker flag with compilation command.
1- Include Header file
#include <stdio.h>
#include <pthread.h>
...
...
2- Compile command
gcc main.c -o main -lpthread

Report Error

View answer Workspace Report Error Discuss

24 5489
Q:

Point out the error, if any, in the following program.

#include "stdarg.h"

main()

{

     display ( 4, 12.5, 13.5, 14.5, 44.3);

}

display(int num, ...)

{

       float c; int j;

        va_list ptr;

        va_start (ptr, num);

        for ( j = 1; j <= num; j++)

        {

            c = va_arg ( ptr, float );

            printf ("\n%f", c);

         }

}

Answer

While extracting a float argument using va_arg we should have useed 


c = va_arg (ptr, double)

Report Error

View answer Workspace Report Error Discuss

Subject: Programming

1 5482
Q:

 In the relational model, relationships between relations or tables are created by using:

A) composite keys. B) determinants.
C) candidate keys. D) foreign keys.
 
Answer & Explanation Answer: D) foreign keys.

Explanation:
Report Error

View Answer Report Error Discuss

Filed Under: Database

1 5431
Q:

What are the different hazards? How do you avoid them?

Answer

There are situations, called hazards, that prevent the next insturction in the instruction stream from executing during its designated clock cycle. hazards reduce the performance from the ideal speedup gained by pipelining.


There are three classes of Hazards:


1. Structural hazards: It arise from resource conficts when the hardware cannot support all possible combinations of instructions simultaniously in overlapped execution.


2. Data Hazards: It arise when an instruction depends on the results of previous instruction in a way that is exposed by the overlapping of instructions in the pipeline.


3.control hazards. it arise from the pipelining of branches and other instructions that chage the PC.

Report Error

View answer Workspace Report Error Discuss

Subject: Hardware

12 5426
Q:

A collection of interrelated records is called a

A) Datasheet B) Spreadsheet
C) Database D) Utility File
 
Answer & Explanation Answer: C) Database

Explanation:
Report Error

View Answer Report Error Discuss

5 5391
Q:

By default, a Linux user falls under which group?

A) same as userid (UPG) B) system
C) staff D) others
 
Answer & Explanation Answer: A) same as userid (UPG)

Explanation:

Linux is a family of open source Unix-like operating systems based on the Linux kernel, an operating system kernel. By default, a Linux user falls under same as userid (UPG) group.

Report Error

View Answer Report Error Discuss

47 5359
Q:

SQL Server program code that is executed instead of an SQL command that needs to be processed is called

A) INSTEAD OF trigger. B) BEFORE trigger.
C) AFTER trigger. D) BEGIN trigger.
 
Answer & Explanation Answer: A) INSTEAD OF trigger.

Explanation:
Report Error

View Answer Report Error Discuss

Filed Under: Database

0 5352
Q:

In HTML, ___________ tag is used to construct drop-down list boxes and scrolling list boxes.

A) <SELECT> B) <OPTION>
C) <TEXTAREA> D) <INPUT>
 
Answer & Explanation Answer: A) <SELECT>

Explanation:
Report Error

View Answer Report Error Discuss

58 5300