Search:

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

Page 1 of 3 1 2 3

Search: Search took 0.03 seconds.

  1. Answers
    3
    Views
    9,839

    Re: switch case vs if else

    First of all, never blindly assume that one method is always going to be faster than the other; code up both versions and measure their relative performance.

    Once you've made that measurement,...
  2. Thread: null pointer

    by jbode
    Answers
    3
    Views
    2,203

    Re: null pointer

    The null pointer is a well-defined "nowhere" that is guaranteed to compare unequal to any valid memory address. It can be used in several different ways:


    Indicate an error condition - standard...
  3. Thread: c++

    by jbode
    Answers
    3
    Views
    1,851

    Re: c++

    There is a difference between function overloading and function overriding.

    You can overload a function or method by declaring or defining multiple functions or methods with the same name in the...
  4. Thread: C Basics

    by jbode
    Answers
    3
    Views
    1,953

    Re: C Basics

    You might find this to be an interesting read.

    Giving it a quick scan, I'm not sure if Ritchie says so explicitly, but the first C compiler was either written in PDP assembler or B.
  5. Answers
    3
    Views
    17,042

    Re: How to Clear Input Buffer

    Contrary to the answers you've gotten so far, you do not want to use fflush to clear an input stream. From the C Language Standard:


    Emphasis mine. Calling fflush on an input stream may clear...
  6. Answers
    3
    Views
    2,091

    Re: Count the Occurence C Sample

    I know this thread is over 5 years old now, but I figured I'd go ahead and post an example.

    This program goes a bit above and beyond the initial request in that it scans for all C keywords, rather...
  7. Thread: Basics of c

    by jbode
    Answers
    3
    Views
    2,025

    Re: Basics of c

    The standard libraries are as much a part of the C language as the grammar. Note that there are two types of execution environments, hosted and freestanding. A hosted environment is what most of us...
  8. Answers
    12
    Views
    14,249

    Re: Differences Between Method and Function

    The terms method, function, procedure, subroutine, and subprogram are all roughly synonymous, although the term function is generally reserved for a subroutine that returns a value. Some languages...
  9. Thread: Limitations of C

    by jbode
    Answers
    3
    Views
    14,567

    Re: Limitations of C

    Depending on the kinds of applications you want to write, C has a number of disadvantages:


    Weak text processing capabilities - C's string library is extremely primitive (it doesn't even define...
  10. Thread: about malloc

    by jbode
    Answers
    3
    Views
    1,866

    Re: about malloc

    Memory allocated by individual malloc() calls should be contiguous. That doesn't hold for multiple calls, though. For example, given the code



    char *p = malloc(10);
    char *q = malloc(20);

    ...
  11. Answers
    4
    Views
    3,777

    Re: Functions in stdlib.h

    Your handy C reference manual should list all of the library functions for each header; if it doesn't, get a better one (I use "C: A Reference Manual" by Samuel Harbison & Guy Steele, currently 5th...
  12. Answers
    4
    Views
    3,010

    Re: Use of sizeof in Malloc

    You don't have to use the sizeof operator in the malloc() call, especially if you're just allocating arrays of char (sizeof (char) == 1 by definition). However, if you're allocating arrays of types...
  13. Thread: funtion swap

    by jbode
    Answers
    9
    Views
    2,207

    Re: funtion swap

    What language, and what are you trying to swap?

    In C++ it's easy:



    template <typename T>
    void swap(T& a, T& b)
    {
    T tmp = a;
Results 1 to 13 of 55
Page 1 of 3 1 2 3
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