void

sizeof(void) equals 1 in C ?

Possible Duplicate: What is the size of void? Hi all ! I am using gcc for compiling my C programs, just discovered accidentally that the sizeof(void) is 1 byte in C. Is there any explanation for this ? I always thought it to be ZERO (if it really stores nothing) ! Thanks ! ...

Returning From a Void Function in C++

Consider the following snippet: void Foo() { // ... } void Bar() { return Foo(); } What is a legitimate reason to use the above in C++ as opposed to the more common approach: void Foo() { // ... } void Bar() { Foo(); // no more expressions -- i.e., implicit return here } ...

How to use .NET reflection to determine method return type (including void) and parameters?

how to know the number and type of parameters? how to know the return type? how to check whether the return type is void? ...

Is void a data type in C?

Hi, Can I know if void is data type in "C"? what type of values it can store, if we have int, float, char etc to store the values why is void needed? ...

C to PHP via SWIG: can’t get void** parameters to hold their value

I have a C interface that looks like this (simplified): extern bool Operation(void ** ppData); extern float GetFieldValue(void* pData); extern void Cleanup(p); which is used as follows: void * p = NULL; float theAnswer = 0.0f; if (Operation(&p)) { theAnswer = GetFieldValue(p); Cleanup(p); } You'll note that Operatio...

Moq modify protected on calling void method

I want to use moq a void method and set a value to a protected property when is called. public class MyClass{ public Guid Id {get; protected set; } } public interface IMyRespository { public void Save(MyClass myClass); } Something like: var moq = new Mock<IMyRespository>(); var my = new MyClass(); moq.Setup(x=>x.Save(my)); I want...

C++ Void non-pointer

I was wondering, why can't there be a void data type that is not a pointer? Surely you could get past the whole determined size thing by having void4 void8 void32 And then only being allowed to 'cast' a void data type to another class if its size is equal or under to the classes size. Is there something that I'm missing, or does the...

Is there any practical use of "Void" structure in .NET

Just of a curiosity, is there any practical use of "Void" struct except in Reflection ? ...

Why use 'href="javascript:void(0);"' instead of something more user friendly?

I'm new to web-design and javascript, and I don't understand why it's common for web designers to use the void(0) syntax below: <a onclick="this.blur();return false;" href="javascript:void(0);" class="btn"> Since this actually shows itself in the lower left hand corner of the browser, why not come up with a way to make it more user f...

Android link to another package's function

I've got two android apps, one with a public void. How would the other app call this function? ...

Can we call a function inside a routine where the function return data type is void?

For example, I have: void(temperature, pressure,time) { int i; double results[10]; for (i = 0 ; i <= 9 ; i++) { fx(temperature, pressure, time); results[i]=fx[i]; } } (P/S: above is the simplified version of my real problem) fx by itself is of course another ste of codes with equations for calcul...

pointer to void

This is kind of basic but I can't seem to get a hold on this one. Reference here Are void *p and const void *p sufficiently different? Why would a function use const void * instead of void *? ...

Can you return a value in Scheme that won't be printed in a list?

I'm trying to return an invisible value in a scheme function, but can't seem to get anything that WONT be printed to the screen, which is what I need. Is there a value in scheme that can be added to a list which won't be printed in a (display) call? ...

Calling a Method in viewDidLoad()

Hello Users, I have a little Problem, i have implemented the following method to open an Image: - (void)ladeImage { id path = @"http://172.23.1.63:8080/RestfulJava/pics"; NSURL *url = [NSURL URLWithString:path]; NSData *data = [NSData dataWithContentsOfURL:url]; UIImage *img = [[UIImage alloc] initWithData:data]; UIImageView *imgView...

P/Invoke C# struct with strings to C void*

I'm having a problem creating a C# P/invoke wrapper around a third party C library. In particular, the library has a method with the signature int command(SomeHandle *handle, int commandNum, void *data, int datasize); It is a wildcard method that does different things depending on commandNum. data can be a pointer to anything, like a s...

Solve Fibonacci Sequence Recursively returning void in function.

My professor has asked us to write a program that uses recursion to solve a fibonacci sequence. This is all pretty normal, but he's asked us to make our function return void. I've been working at this for a few days now and can't find a way to do this. I have: void fibonacci(double *n,double *x,double *y,double *result) { if(*n ...

converting ID events to void events

Is it possible to convert this: - (id)initWithFrame : (NSRect)frame { if (self = [super initWithFrame:frame]) { [self setFont:[NSFont fontWithName:@"Arial" size:0.0]]; // [self startTask]; } return self; } to make it a void? thanks, Elijah ...

Intercepting only void return calls using AspectJ

I have a trace aspect that should log: Entering Exiting (return type is void) Returning [returned object] Throwinig [Exception message] I am having problems with the second. How do I create an advice for this case without double-logging all exits that also return something as is the case now when I have one @After advice and one @Aft...

How bad is to use void pointer in std::vector declaration?

I have to different classe: class text { }; class element { }; And I want to store them in the class node: template <typename T> class node { T cargo; std::vector<void*> children; node(T cargo) : cargo(cargo) { }; void add_child(T node) { this->children.push_back((void*) node); } } So I would...

Calling a non-void function without using its return value. What actually happens?

So, I found a similar question here, but the answers are more about style and whether or not you are able to do it. My question is, what actually happens when you call a non-void function that returns an object, but you never assign or use said returned object? So, less about whether or not you can, because I absolutely know you can and...