void func(int a[], int pos)
{
a[pos] = 8888
}
那就这样:
void func(int a[], int pos)
{
a[pos] = 8888
}
我大概明白了你的意思,看看这个:
#include "stdafx.h" //VS 预编译头文件,其他系统请删除
#include<stdio.h>
#include<stdlib.h>
//VS 2013 否决了 scanf 等函数,为了使用,加上下句。
//其他系统请删除
#pragma warning(disable:4996)
void func(int *parr, int *pos, int sz)
{
printf("输入 -1 结束本次输入:\n")
int c
for ()
{
if (*pos == sz)
{
printf("\n数组已满,不能再接收数据!\n")
break
}
scanf("%d", &c)
if (c == -1)
break
parr[*pos] = c
*pos += 1
}
}
//VS 主函数签名格式。其他系统请改变签名,如:
//int main()
int _tmain(int argc, _TCHAR* argv[])
{
#define ARRSIZE 10
int arr[ARRSIZE]
int pos = 0
while (pos <ARRSIZE)
{
func(arr, &pos, ARRSIZE)
}
for (int i = 0i <ARRSIZEi++)
printf("%d", arr[i])
printf("\n")
system("pause")//避免窗口一闪而退
return 0
}
设为全局就可以了var addArray = new Array() //新建数组存储 选中或取消的复选框
function addToArray(id) { //此处id为复选框的id,动态生成的
addArray.push(id)
alert(addArray.length)
}
@file_put_contents( './' . date("Y-m-d") . ".log", date('Y-m-d H:i:s') . " " . $mess . PHP_EOL, FILE_APPEND )你在file_put_contents函数中添加参数FILE_APPEND
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)