如何在void / int函数中转换?

问题描述 投票:-1回答:1

如何将struct Node *函数转换为int / void函数?我的意思是让我们假设我们给了函数“ struct Node *(struct Node ** p,int y)”现在我想将其转换为void / int函数,那我该怎么办?

c++ c
1个回答
0
投票

[int main是包含库之后的起始代码,它是在执行结束时通过在末尾键入return 0;来返回值,例如:-

# include <stdio.h>

int main(){

int a; // assigning a variable

a=10; //assignig a value to the variable
printf("the number is %d",a); // this is the print statment

return 0;
}

void main是您不希望返回值的时间

但是要将int main转换为void main,您必须像这样更改它:-

# include <stdio.h>



void main(){

int a; // assigning a variable

a=10; //assignig a value to the variable
printf("the number is %d",a); // this is the print statment

}
© www.soinside.com 2019 - 2024. All rights reserved.