About 167,000 results
Open links in new tab
  1. Pointers in C: when to use the ampersand and the asterisk?

    When dealing with functions and pointers, the rule to remember is: if you want to change the value of an argument and have it reflected in the calling code, you must pass a pointer to the thing you want to …

  2. c++ - Why use pointers? - Stack Overflow

    Oct 2, 2008 · If you use straight C, the need for pointers is much more obvious: there's no other way to do call-by-reference, it's the best way to store a string, it's the best way to iterate through an array, etc.

  3. Why Use Pointers in C? - Stack Overflow

    Apr 3, 2015 · I'm still wondering why in C you can't simply set something to be another thing using plain variables. A variable itself is a pointer to data, is it not? So why make pointers point to the data in...

  4. How do function pointers in C work? - Stack Overflow

    You can use function pointers as a way to delegate some task or functionality. The classic example in C is the comparison delegate function pointer used with the Standard C library functions qsort() and …

  5. Is there pointer in C# like C++? Is it safe? - Stack Overflow

    Feb 25, 2010 · Is there pointer in C# too? Yes, declared using the syntax int* varName;. Is using of that safe? No pointers are not safe. There are safe ways to construct a data structure without pointers. If …

  6. How do pointer-to-pointers work in C? (and when might you use them?)

    Pointers to Pointers Since we can have pointers to int, and pointers to char, and pointers to any structures we've defined, and in fact pointers to any type in C, it shouldn't come as too much of a …

  7. When to use pointers in C#/.NET? - Stack Overflow

    Jan 28, 2014 · I know C# gives the programmer the ability to access, use pointers in an unsafe context. But When is this needed? At what circumstances, using pointers becomes inevitable? Is it only for …

  8. c - What is the use of function pointers? - Stack Overflow

    The only common use I can think of that cannot be generalized as dependency inversion is implementing switch-like flow control on non-switchable data types. For example, if you've ever …

  9. When to use pointers, and when not to use them - Stack Overflow

    Feb 23, 2015 · My question is, when to use them, and when not?. Currently, in many cases i'm asking myself, should I use a pointer here or just pass the variable itself to the function. For instance, I know …

  10. Why should I use a pointer rather than the object itself?

    Mar 3, 2014 · See the Pimpl idiom. You need to interface with a C library or a C-style library. At this point, you're forced to use raw pointers. The best thing you can do is make sure you only let your raw …