Questions tagged [void]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
0
votes
1answer
30 views

Why does PrintName return void?

Okay so in the PrintName function, it contains a printf function. However, I read that printf returns a value which is the number of characters. Shouldn't PrintName hence return an int as well? Thanks!...
1
vote
1answer
166 views

is that a function pointer and how can it be used?

I've seen a typedef operation in the following format in signal function's man page: #include <signal.h> typedef void (*sighandler_t)(int); sighandler_t signal(int signum, ...
0
votes
1answer
45 views

use of void argument with a function

I am learning cs50 through EdX. In week2-lec1, while explaining user defined functions, Prof David used void along with the function GetPositiveInt as arg. If void is used for functions, not ...
2
votes
1answer
867 views

Is there any difference between foo(void) and foo()? (is ´void´ just a convention?)

When we declare we use int foo(void); But when we use the function, it goes: string s = foo() Is void just a convention? Does it do anything in particular different from ()?
0
votes
1answer
500 views

int GetInt(void) and command line arguments

Why don't the Get functions, GetString, GetInt etc, take command line arguments like the main function? It seems to me that they should since command lines are being inputed into the function.