栈的大小是固定的,这也就意味着不能无限的递归。递归到某些时候,栈顶将会没有更多空间来添加新的栈顶—就好像橱柜的空间被挤满,不能增加一个盘子一样void recurse(){ recurse(); //函数调用其自身}int main(){ recurse();//开始递归}//最终 栈空...
分类:
其他好文 时间:
2015-04-15 13:26:44
阅读次数:
121
1,介绍variadic function可变参数的函数就是参数数量可以改变的函数。例如printf();int printf(const char *format, ...);printf("%d%s\n",i,s);C语言之所以可以支持可变参数函数,一个重要的原因是C调用规范中规定C语言函数调用...
分类:
其他好文 时间:
2015-04-15 13:26:40
阅读次数:
167
#include "stdio.h"#include "string.h"#define MAXSIZE 100typedef struct{ char key[15]; char name[20]; int age;}DATA;typedef struct { DATA ListData[MAXS...
分类:
其他好文 时间:
2015-04-15 13:23:57
阅读次数:
107
1.dimens.xml文件: 100dp2.layout.xml中调用//3.activity中调用int margin_top = getResources().getDimension(R.dimen.area_margin_top);ok,没问题,运行正常。注:dimen.xml中area_...
分类:
移动开发 时间:
2015-04-15 13:16:00
阅读次数:
178
#includevoid show(int arr[], int length){ for(int i=0; i arr[j]) { _swap(&min, &arr[j]); } } //将最小的数放到正确的位置 if(arr[i] != min) { _swap(...
分类:
编程语言 时间:
2015-04-15 13:13:45
阅读次数:
142
top可以用来表示下标。top为-1表示栈空,其他情况top表示栈顶元素的下标1 typedef int SElemType;2 struct SqStack{3 SElemType *base;4 int top;5 int stacksize;6 };
分类:
其他好文 时间:
2015-04-15 13:13:42
阅读次数:
132
实现一个函数,给定一个数组,要求使得数组中负数在所有正数的前面实现一个函数,给定一个数组,要求使得数组中负数在前正数在后零在中间 1 #include 2 #include 3 4 //输出数组元素 5 void print(int *arr, int len); 6 //交换两个数 7 void....
分类:
编程语言 时间:
2015-04-15 12:57:41
阅读次数:
199
struct 定义初始化#include typedef struct stuInfo { char stuName[10]; //姓名 int stuId; //学号 int age; //年龄 char sex; ...
分类:
其他好文 时间:
2015-04-15 12:54:55
阅读次数:
106
package com;public class ConpectOne{ public static void main(String[] args) { ConpectOne co = new ConpectOne(); String J = ""; int y = 0; co...
分类:
其他好文 时间:
2015-04-15 12:44:36
阅读次数:
126
#include
using namespace std;
void swap(int *a,int *b)
{
int temp = *a;
*a = *b;
*b = temp;
}
void Grial(int a[],int x,int y)
{
int i=x-1;
int j=x;
int key = a[y];
if(x>=y)return ;
while(j<y...
分类:
编程语言 时间:
2015-04-15 11:27:18
阅读次数:
192