Questions tagged [void]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
0 votes
1 answer
52 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!...
user107224's user avatar
1 vote
1 answer
311 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, ...
vhatharvard's user avatar
0 votes
1 answer
53 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 ...
N Shaikh's user avatar
2 votes
1 answer
2k 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 ()?
Martin's user avatar
  • 201
0 votes
1 answer
551 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.
William Kenney's user avatar