void Questions

3

Solved

In TypeScript, you can annotate a function as returning void: function fn1(): void { // OK } function fn2(): void { // Error return 3; } You can also annotate a function to return undefined:...
Kingdon asked 15/11, 2019 at 22:27

5

Solved

I wrote this simple class in java just for testing some of its features. public class class1 { public static Integer value=0; public class1() { da(); } public int da() { class1.value=class1....
Virulence asked 25/7, 2014 at 20:9

7

Solved

In API "The Void class is an uninstantiable placeholder class to hold a reference to the Class object representing the Java keyword void." What is "uninstantiable" place holder class? When w...
Neumark asked 31/5, 2012 at 18:18

10

Solved

What does the following mean : int main(void) {...} VS int main() {...} ? I think that int main() {...} means that main doesn't receive any parameters (from command line) , however: int main(int...
Mcandrew asked 1/9, 2012 at 5:30

6

Solved

how can I convert any object of my own class convert into pointer to void? MyClass obj; (void*)obj; // Fail
Enterpriser asked 30/6, 2011 at 11:47

10

Solved

int fn(); void whatever() { (void) fn(); } Is there any reason for casting an unused return value to void, or am I right in thinking it's a complete waste of time?
Yakka asked 27/3, 2009 at 13:0

5

Solved

Is there any way to force an exhaustive check of all enum values when the switch branches call methods with void return type? It's quite ugly to hard-code a yield just to coax the compiler to deman...
Rainbolt asked 15/2, 2021 at 7:56

1

Go introduced generics in version 1.18. I just downloaded the latest beta version to test this major new feature. Consider the code below: package main import "fmt" func Demo1(n int) in...
Wastebasket asked 8/2, 2022 at 17:36

1

Solved

C2x, 6.5.3.2 Address and indirection operators, Constraints, 2: The operand of the unary * operator shall have pointer type. Why there is no constraint "the operand shall not be a pointer to...
Flavor asked 7/2, 2022 at 16:34

4

Solved

My experience is in C-based languages (C, C++, Java, C#) where the return type of a function can be void, i.e no return. But in Ruby, it appears that every function returns something. I was wonderi...
Garcon asked 9/3, 2013 at 9:33

1

Solved

Why this code: extern void x; leads to: $ cl t555.c /std:c11 /Za t555.c(1): error C2182: 'x': illegal use of type 'void' What is illegal here? UPD. Use case: $ cat t555a.c t555.p.S #include <s...
Said asked 1/2, 2022 at 23:20

11

Solved

How to mock methods with void return type? I implemented an observer pattern but I can't mock it with Mockito because I don't know how. And I tried to find an example on the Internet but didn't ...
Tenney asked 16/2, 2010 at 20:54

3

Solved

I think that typescript has many unobvious places, making it not strict and not correct. I want use undefined as functions return type. Because in reality it is undefined, not void or some other fi...
Hallah asked 12/1, 2021 at 20:19

2

Solved

I am having a strange issue on TypeScript. I recently learnt about void ... operator because I need to apply it so eslint wouldn't report no-floating-promises. However this particular snippet someh...
Spireme asked 10/1, 2022 at 8:59

4

Solved

I want to stub a repository class to test another class (Holder class) that has a repository. The repository interface supports CRUD operations, and has many methods, but my unit test on the Holder...
Azevedo asked 21/8, 2015 at 11:33

6

Solved

I have a function called: void initializeJSP(string Experiment) And in my MyJSP.h file I have: 2: void initializeJSP(string Experiment); And when I compile I get this error: MyJSP.h:2 erro...
Stokehold asked 12/12, 2008 at 21:31

4

Solved

I am getting this error: - This expression has a type of 'void' so its value can't be used. Try checking to see if you're using the correct API; there might be a function or call that returns void ...
Hanrahan asked 3/8, 2020 at 9:3

1

I am learning about templates in C++, and came across an example where casting to void is used: template<typename T> auto func (T const& t) -> decltype( (void)(t.size()), T::size_type(...
Nan asked 24/9, 2021 at 11:52

4

Solved

I read this MSDN article: Unit Type (F#) ...The unit type is a type that indicates the absence of a specific value; the unit type has only a single value, which acts as a placeholder when no ...
Gallfly asked 20/12, 2013 at 13:37

4

Solved

I saw some usage of (void*) in printf(). If I want to print a variable's address, can I do it like this: int a = 19; printf("%d", &a); I think, &a is a's address which is just an integ...
Perplexity asked 3/9, 2011 at 3:15

1

So I want to create a Mono<Void> (or any Mono<SomeIgnorableType>) that actually emits an element. Why? Because I actually want to run an effect, and the result just implies the effect w...
Neisa asked 25/3, 2021 at 21:6

7

Solved

In a recent question, someone mentioned that when printing a pointer value with printf, the caller must cast the pointer to void *, like so: int *my_ptr = .... printf("My pointer is: %p", (void *...
Yachting asked 21/7, 2014 at 14:37

14

Solved

<a href="javascript:void(0)" id="loginlink">login</a> I've seen such hrefs many times, but I don't know what exactly that means.
Thamora asked 18/8, 2009 at 5:20

1

Solved

My script exports some information from Sharepoint sites to a .CSV file. # Enter Web Application URL $WebAppURL="http://server" # Enter Path to CSV-file $CSVFilePath="Path" $S...
Blakeslee asked 26/1, 2021 at 17:53

5

Solved

In my project I have a Settings form and a Main form. I'm trying to call the Main form's MasterReset function from the Setting form, but nothing happens. The Master form's Masterreset function look...
Haslett asked 29/11, 2013 at 12:45

© 2022 - 2024 — McMap. All rights reserved.