Search:

Type: Posts; User: sk_seeker; Keyword(s):

Page 1 of 2 1 2

Search: Search took 0.00 seconds.

  1. Thread: union

    by sk_seeker
    Answers
    3
    Views
    3,249

    Re: union

    You are right.

    A practical example is listed below.

    Let us say that there are two types of blocks.
    blk_type == A; dependent data is an integer
    blk_type == B; dependent data is a char array...
  2. Thread: #if

    by sk_seeker
    Answers
    3
    Views
    3,316

    Re: #if

    Question is a bit vague: so treat the answer with a grain of salt.

    It depends on the expression in #ifdef EXPR.

    For example, if it is #ifdef __KERNEL, then standard user mode functions will...
  3. Answers
    3
    Views
    9,188

    Re: c interview questions

    If you have programmed in C, you should know most of the questions and answers. Some of the general debugging areas to test a candidate are:
    + What is a memory leak?? How do you debug it??
    + How do...
  4. Answers
    4
    Views
    6,311

    Re: Learn Pointers in C

    Let me give you a simple method to start becoming good in using pointers.

    Make it a habit of never using global variables. Always pass arguments by reference (by pointer) and see how fast you...
  5. Answers
    5
    Views
    11,216

    Unix/Linux Re: inode number !!!

    This is wrong. Read my earlier post to get an idea or read a Unix Internals book like the one authored by Uresh Vahalia or some other book like that. Specifically, concentrate on the concept of inode...
  6. Answers
    3
    Views
    3,428

    Re: String to int conversion...

    This is a buggy program. Here is why:

    1.
    no = malloc(sizeof(char*)); // 4 bytes of characters

    Memory space of 4 bytes (32 bit machine) is being allocated by malloc.
    Let us say that the...
  7. Thread: Code Output

    by sk_seeker
    Answers
    2
    Views
    3,054

    Re: Code Output

    The expression inside the while loop is: *b++ = *a++.
    Let us simplify this expression into two steps:

    - *b = *a
    - b++; a++

    Since b and a are pointing to strings as per your email,
    - *b = *a...
  8. Answers
    2
    Views
    3,010

    Unix/Linux Re: Unix Predefined File Formats

    You are not asking the right question. File systems are different from file formats. So, lets do some digging.

    1.
    Let us consider a 2GB hard disk. This hard disk can be used in a Unix machine or...
  9. Thread: Core Dump

    by sk_seeker
    Answers
    2
    Views
    3,504

    Unix/Linux Re: Core Dump

    Lets follow a logical sequence to answer your question.

    1.
    When are core files are created? When the program does something bad.

    2.
    What is something bad?? Can be many things, but lets list...
  10. Re: how we can read database file in C language?

    .mdb is a microsoft access dB file format. To read this using C, you will need to do the following.

    The first thing to do is to find out if this file format is an "open" standard i.e. can one...
  11. Answers
    5
    Views
    24,148

    Re: Structure Padding in C

    Wonderful. This is exactly the discussion I wanted to have.

    So, yes.
    - As Kalayama said, depending on the compiler (16 or 32 or 64bit), the padding size differs. But, why have padding at all?? ...
  12. Answers
    5
    Views
    24,148

    Structure Padding in C

    Let us assume that a structure in C is declared as below:

    struct aaa {
    int a;
    char b;
    int c;
    }

    Assuming that I am running on a 32-bit machine, can I assume that the size of the...
  13. Re: Why we are using the int in Malloc function

    Good basic question. Here is the answer.

    Many C programs assume that the size of an integer was 16 bits i.e. 2 bytes. But, this is not guaranteed. C standard does not specify the sizes of the...
  14. Answers
    3
    Views
    5,178

    Re: Static variables in multiuser environment

    This question is a trap. Be careful how you answer this. The answer is that the value is non-deterministic due to the possibility of a race condition.
    Details below.

    - Lets take an example. Let...
  15. Answers
    6
    Views
    8,646

    Re: pointers and union?

    W.r.t your first question, let me list an example.
    Each page in memory is represented by a Page Frame Descriptor (pfd). The pfd contains all the information about the physical page like page size,...
  16. Answers
    6
    Views
    47,747

    Re: Advantages of using pointers in C

    This was an interesting question. This reminded me to keep in touch with the basics: easy to forget them.

    Okay. Here are the advantages of pointers as I see it.
    - Pointers allow you to implement...
  17. Answers
    5
    Views
    11,216

    Unix/Linux Re: inode number !!!

    Inodes are the in-memory representation of files. This means that all the information needed about files (like disk block nos for the file data, permissions, etc) are stored in the inode structure....
  18. Answers
    13
    Views
    113,676

    Re: What approach you will follow?

    Hmm... is this a trick question :)

    "0" i.e. string zero. i.e. it is a pointer. So, you have replaced an integer of 48 by an address. Assuming this, you might see a huge value. Maybe this will help...
  19. Answers
    3
    Views
    4,997

    Re: Need help in routinely asked question

    I can shed some light on the first question, with one caveat. The answer to this question should come from within you. Lets say you want job security. But, this is an answer which can be...
  20. Answers
    4
    Views
    3,438

    Re: Set sixth bit to 1

    You could also use the OR and AND operators to help you put.

    #define MASK1 0x0040 // Note that 6th bit is 1, counting from 0
    #define MASK2 0xffbf // Note that the 6th bit is 0

    // Set...
  21. Answers
    6
    Views
    12,851

    Re: null statement in c

    Nice succint explanation. I have one comment and one question on this topic.

    1.
    The for() loop example is a dangerous programming practice. This should never be used as it is very easy to miss...
  22. Thread: hi

    by sk_seeker
    Answers
    3
    Views
    2,977

    Re: hi

    You need to let us know what is your difficulty in writing a program to match the specifications. Did you not understand the problem OR are you having difficulty in implementing it??

    One can...
  23. Answers
    4
    Views
    3,756

    Re: one doubt in C Quiz

    With the details you have given, you are absolutely right in that without a typedef, there is no way that we can skip the struct in most C compilers. Infact, even if the fancy compiler allowed you to...
  24. Answers
    4
    Views
    8,130

    Re: File Handling in C

    Hmm..... this question is too vague to actually give an answer. So, let me ask a few questions so that it will help you clarify your question better.

    1.
    Looks like you are creating some sort of a...
  25. Answers
    6
    Views
    13,675

    Re: static array or dynamic array?

    Is this a trick question :)

    First of all, you need to specify the language where you want this answer.

    2.
    Lets assume you are programming in C. Then, there is no way one can find the number...
Results 1 to 25 of 45
Page 1 of 2 1 2
About us
Applying for a job can be a stressful and frustrating experience, especially for someone who has never done it before. Considering that you are competing for the position with a at least a dozen other applicants, it is imperative that you thoroughly prepare for the job interview, in order to stand a good chance of getting hired. That's where GeekInterview can help.
Interact