void

Accessing void pointers in Python (using SWIG or something else)

I've been trying to use SWIG to wrap around a simple library that uses ioctl() to populate a structure like the following: struct data { header* hdr; void* data; size_t len; }; data is a pointer to a buffer, len is the length of that buffer. I'm unable to figure out how to convert data to a Python string (or array). Furthermore...

What is the need of Void class in Java

I am not clear with the class java.lang.Void in Java. Can anybody elaborate in this with an example. ...

Silktest void 0 bug?

I'm running some tests with Silk and it keeps throwing this error "void 0". Does anyone have any idea how I can stop this code from executing? My platform is XP SP3, and FireFox 3.6. Anyone have any ideas? ...

Sending items in a LINQ sequence to a method that returns void

Hello all. Often while I'm dealing with LINQ sequences, I want to send each item to a method returning void, avoiding a foreach loop. However, I haven't found an elegant way to do this. Today, I wrote the following code: private StreamWriter _sw; private void streamToFile(List<ErrorEntry> errors) { if (_sw == null...

Custom Cocoa Framework and a problem using it

Hello, I made a custom cocoa framework just to experiment and find the best way to make one but ran in to a problem using it. The framework project builds and compiles just fine, but when I use it in an xcode project I get the error, 'LogTest' undeclared. The name of the framework is LogTest Heres the code to my app that uses the frame...

IPHONE SDK, How to put Void function into my BOOL??? PLEASE!

I am using the IPhone's Accelerometer to make a object move. I want to be able to make this function work and not work depending on different states. I have my code for my Accelerometer function and i want to put it into a BOOL so i can call on it when i need it, but i am having problems. Can anyone Help me put this code into a BOOL na...

IPhone sdk stop the accelerometer from working when something happens.

Hi, I am using the accelerometer to move a few UIImageViews around the screen, at the moment the accelerometer only works when a NSTimer is at 0, this is fine. I would also like to make the accelerometer stop again when a different function happens. here is my code at the moment: -(BOOL) accelerometerWorks { return time == 0; } -(voi...

c incompatible types in assignment, problem with pointers?

Hi I'm working with C and I have a question about assigning pointers. struct foo { int _bar; char * _car[SOME_NUMBER]; // this is meant to be an array of char * so that it can hold pointers to names of cars } int foofunc (void * arg) { int bar; char * car[SOME_NUMBER]; struct foo * thing = (struct foo *) arg; bar =...

How to access a structure member in a function that get it as void* type?

I want to have a function that accepts different type of structures as argument. So, since I don't have a specific type, I have to use void*. Now question is: when I pass a structure to this function, how can I access a known member of this structure inside the function? Specifically, I know that all structures have str1 as a member and...

Call a void* as a function without declaring a function pointer

I've searched but couldn't find any results (my terminology may be off) so forgive me if this has been asked before. I was wondering if there is an easy way to call a void* as a function in C without first declaring a function pointer and then assigning the function pointer the address; ie. assuming the function to be called is type vo...

From Java Object class to C++

Hi, I'm relative new to C++ and my background is in Java. I have to port some code from Java to C++ and some doubts came up relative to the Object Java's class. So, if I want to port this: void setInputParameter(String name, Object object) { ..... } I believe I should use void* type or templates right? I don't know what's the "standar...

How do I cast a void pointer to a struct in C?

In a project I'm writing code for, I have a void pointer, "implementation", which is a member of a "Hash_map" struct, and points to an "Array_hash_map" struct. The concepts behind this project are not very realistic, but bear with me. The specifications of the project ask that I cast the void pointer "implementation" to an "Array_hash_ma...

Is it legitimate to pass an argument as void*?

I have just started learning pthreads API and I am following the tutorial here However, in an example program of pthread_create, the sample program creates a long variable and passes its value, typecasted as void*. In the thread entry function, it dereferences it just like a long. Is this legit? I understand if I pass the address of v...

Void in main and keeping Dos program from dying

Possible Duplicate: Difference between void main and int main? Alright, so I'm using bloodshed complier, first thing I should note is I'm using a 2001 edition C++ for the absolute beginner, was there any changes to C++ since 2001 that would effect the validity of this book? I ask because I know php has php5 and now php6 but I...

Need for prefixing a function with (void)...

Hi All, I recently came across a rather unusual coding convention wherein the call for a function returning "void" is prefixed with (void). e.g. (void) MyFunction(); Is it any different from the function call like: MyFunction(); Has it got any advantage or is it yet another needless but there coding convention of some...

How to implement an interface member that returns void in F#

Imagine the following interface in C#: interface IFoo { void Bar(); } How can I implement this in F#? All the examples I've found during 30 minutes of searching online show only examples that have return types which I suppose is more common in a functional style, but something I can't avoid in this instance. Here's what I have s...

Why syntax error occurs when a void function is checked in IF statement.

What will be the output if I write In C++ if(5) will be executed without any problem but not in C# same way will it be able to run. if(func()){} //in C# it doesn't runs Why how does C# treats void and how in Turbo C++ void func() { return; } if(null==null){}//runs in C# EDIT if(printf("Hi"){} //will run and enter into if statemen...

C++ void type - how?

typedef void(Object Sender) TNotifyEvent; This is what I'm trying to do from Delphi to C++, but it fails to compile with 'type int unexpected'. The result should be something I can use like that: void abcd(Object Sender){ //some code } void main{ TNotifyEvent ne = abcd; } How do I make such type(of type void)? I'm not very fa...

Void Verbs in J

I'm learning how to use J via online reading and doing some old Java assignments over again using this language, and would like to know how to make a verb that doesn't take any operands, or return any result. The reason being: I would like to allow myself the ability to type in a verb, let's call it go that would run a sequence of code o...

Deleting a nested struct with void pointers as members?

I have the following class: class Stack { struct Link { void* data; Link* next; void initialize(void* dat, Link* nxt); }* head; public: void initialize(); void push(void* dat); void* peek(); void* pop(); void cleanup(); }; The pop method is: void* Stack::pop() { if(head == 0) return 0; void* result = hea...