Yahoo India Web Search

Search results

  1. Jun 25, 2009 · Basically it means "nothing" or "no type". There are 3 basic ways that void is used: Function argument: int myFunc(void) -- the function takes nothing. Function return value: void myFunc(int) -- the function returns nothing. Generic data pointer: void* data -- 'data' is a pointer to data of unknown type, and cannot be dereferenced.

  2. Jul 24, 2012 · This also works for C language. The void type of pointer is a special type of pointer. In C++, void represents the absence of type, so void pointers are pointers that point to a value that has no type (and thus also an undetermined length and undetermined dereference properties).

  3. Nov 6, 2011 · probably tells the compiler that you intended to do so. void is an incomplete type that cannot be completed. That means that an expression of type void can only be used in a context that doesn't expect a value. And you're right, an expression of type void cannot be used as an lvalue or rvalue.

  4. Sep 21, 2016 · In ANSI C 89, when using void main and compiling the project AS -ansi -pedantic (in Ubuntu, e.g) you will receive a warning indicating that your main function is of type void and not of type int, but you will be able to run the project. Most C developers tend to use int main() on all of its variants, though void main() will also compile.

  5. Sep 1, 2012 · But in C they are little bit different. int main () indicates that the main function can be called with any number of parameters or without any parameter. On the other hand, int main (void) indicates that the main function will be called without any parameter. #include <stdio.h>.

  6. Aug 15, 2010 · Yes, void is a type. Whether it's a data type depends on how you define that term; the C standard doesn't. The standard does define the term "object type". In C99 and earlier; void is not an object type; in C11, it is. In all versions of the standard, void is an incomplete type.

  7. Apr 21, 2023 · 16. void* is a "pointer to anything". void ** is another level of indirection - "pointer to pointer to anything". Basically, you pass that in when you want to allow the function to return a pointer of any type. &variable takes the address of variable. variable should already be some kind of a pointer for that to work, but it's probably not void ...

  8. Dec 17, 2016 · The static keyword is somewhat over used. When it applies to function, it means that the function has internal linkage, ie its scope is limited to within a translation unit (simply as a source file). By default, function is non-static and has external linkage. The function can be used by a different source file.

  9. Dec 29, 2018 · In C language the void type has been introduced with the meaning of 'don't care' more than 'null' or 'nothing', and it's used for different scopes. The void keyword can reference a void type, a reference to void, a void expression, a void operand or a void function. It also explicitly defines a function having no parameters.

  10. Mar 23, 2011 · int register_callback(void (*foo)(void *baz), void *bar); register_callback is called with a pointer to a void function that expects as parameter a pointer that presumably means something to it. At some (unspecified) time in the future, that function will be called, with bar as the parameter.