C function (without parameters) call with parameters

leon22

I'm wondering something like this is possible:

// declaration
void func();

int main()
{
    int ar[] = { 1, 2, 3 };
    func(ar); // call with parameter
    return 1;
}

void func() // no parameters
{
    // do something
}

Can someone explain me this and especially how can I access ar in func()?

zegkljan

In C (not C++), a function declared as func() is treated as having an unspecified number of untyped parameters. A function with no parameters should be explicitly declared as func(void).

この記事はインターネットから収集されたものであり、転載の際にはソースを示してください。

侵害の場合は、連絡してください[email protected]

編集
0

コメントを追加

0

関連記事

分類Dev

C++ function call without enough template parameters

分類Dev

Is there a way to call function without passing its parameters?

分類Dev

Call Javascript function with parameters inside PHP

分類Dev

Lua Gideros: Call function with multiple parameters

分類Dev

Template parameter deduction for parameters not used in function call

分類Dev

Call function from a custom file with parameters

分類Dev

Easier way to call a function with many parameters?

分類Dev

Create new Function and pass parameters without calling it

分類Dev

Call stored procedure in EF 6 Repository Pattern without output parameters

分類Dev

Call JavaScript function from code behind in loop with parameters

分類Dev

Call Method with parameters in AppDelegate

分類Dev

A delegate for a function with variable parameters

分類Dev

Optional templated parameters for a function

分類Dev

Passing parameters to jest function

分類Dev

Using an object for function parameters

分類Dev

Function traits for default parameters

分類Dev

Named bash function parameters

分類Dev

Is there a "generic" iterator type to be used in C++ for function parameters?

分類Dev

How to declare multiple template parameters with c++11 function callback

分類Dev

"Too Many Initializer Values" in C++ function parameters

分類Dev

Bash -c with positional parameters

分類Dev

Void Parameters in C

分類Dev

Golang: Passing structs as parameters of a function

分類Dev

Pass no value to function with default parameters

分類Dev

Javascript: Understanding function syntax and parameters

分類Dev

Build function parameters with variadic templates

分類Dev

Index signature for objects with function parameters

分類Dev

jQuery width function parameters not working

分類Dev

Moq mocking a function with expression parameters

Related 関連記事

  1. 1

    C++ function call without enough template parameters

  2. 2

    Is there a way to call function without passing its parameters?

  3. 3

    Call Javascript function with parameters inside PHP

  4. 4

    Lua Gideros: Call function with multiple parameters

  5. 5

    Template parameter deduction for parameters not used in function call

  6. 6

    Call function from a custom file with parameters

  7. 7

    Easier way to call a function with many parameters?

  8. 8

    Create new Function and pass parameters without calling it

  9. 9

    Call stored procedure in EF 6 Repository Pattern without output parameters

  10. 10

    Call JavaScript function from code behind in loop with parameters

  11. 11

    Call Method with parameters in AppDelegate

  12. 12

    A delegate for a function with variable parameters

  13. 13

    Optional templated parameters for a function

  14. 14

    Passing parameters to jest function

  15. 15

    Using an object for function parameters

  16. 16

    Function traits for default parameters

  17. 17

    Named bash function parameters

  18. 18

    Is there a "generic" iterator type to be used in C++ for function parameters?

  19. 19

    How to declare multiple template parameters with c++11 function callback

  20. 20

    "Too Many Initializer Values" in C++ function parameters

  21. 21

    Bash -c with positional parameters

  22. 22

    Void Parameters in C

  23. 23

    Golang: Passing structs as parameters of a function

  24. 24

    Pass no value to function with default parameters

  25. 25

    Javascript: Understanding function syntax and parameters

  26. 26

    Build function parameters with variadic templates

  27. 27

    Index signature for objects with function parameters

  28. 28

    jQuery width function parameters not working

  29. 29

    Moq mocking a function with expression parameters

ホットタグ

アーカイブ