关于C语言中按值调用的问题
作者:Thilina 提问时间:7/4/2023
当我运行这个程序时,它会输出(第一个代码片段)。10 20 #include <stdio.h> int x = 10; int y = 20; int main() { fun(x, y);...
按值传递 问答列表
作者:Thilina 提问时间:7/4/2023
当我运行这个程序时,它会输出(第一个代码片段)。10 20 #include <stdio.h> int x = 10; int y = 20; int main() { fun(x, y);...
作者:itzmartin_20 提问时间:6/20/2023
我最近刚开始DSA,这个问题可能看起来微不足道,但非常感谢那些认真对待它的人。这是我的程序: #include<stdio.h> #include<stdlib.h> struct node{ ...
作者:g1e2h3 提问时间:3/13/2023
所以我试图在列表的开头添加一个元素。函数prepend_list位于第 27 行。我试图以两种不同的方式进行它,一种是返回一个列表,另一种是 void 函数。 #include "base.h" #...
作者:Paul Wicks 提问时间:4/20/2009
因此,我有一些代码,类似于以下内容,用于将结构添加到结构列表中: void barPush(BarList * list,Bar * bar) { // if there is no move t...
作者:SKumar 提问时间:9/19/2022
x,y = 30,40 def swap(x,y): x = x+y y = x-y x = x-y print(x,y) #Here it swaps but as soon as fu...
作者:Saurabh Damle 提问时间:10/4/2022
这个问题在这里已经有答案了: 如何克隆列表,使其在分配后不会意外更改? (24 个回答) 去年关闭。 我正在尝试将矩阵(列表列表)作为参数传递给函数。我想保持原始矩阵值不变。如何在 python 中...
作者:Ashiful Islam Prince 提问时间:9/25/2020
这是我制作的程序: #include <stdio.h> int main(void) { //Put variables here int space = 0; int num_of_ro...
作者:Jeff 提问时间:11/10/2022
我有一个master_macro调用其他 2 个宏:(sub)calc 和 (sub)transfer。calc 宏不需要传递给它的任何变量,但另一个变量需要,当master_macro调用传输宏时,...
作者:Lama RL 提问时间:11/12/2022
我正在尝试在 C 头文件中定义变量。然后在函数中处理这些变量,并在 main 函数中使用这些变量的新值。 代码如下所示: C 头 : #ifndef _myheader_h #define _my...
作者:elmarti 提问时间:2/8/2023
我试图弄清楚我的代码出了什么问题。编译时,没有错误或警告,只是分段错误。 有人可以告诉我我做错了什么吗? #include "funciones.h" #define FILAS 5 #defi...