需要解决一个C++问题 希望高手帮忙
来源:百度知道 编辑:UC知道 时间:2024/06/07 04:33:15
/**************************************************/
/*以下是我刚写的代码,实现了升序的功能**************/
/*在linux下g++ 直接编译后可执行vc没环境试是否可用**/
/*首先输入文件名,然后选择升(a)降(d)序里面有提示****/
/*程序功能:将文件的内容读入内存后按要求的顺序放入链表*/
/*然后显示,只实现了升序的功能,不妨自己试试把降序的功能实现了*/
/*****************************************************/
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#define NLEN sizeof(struct Node)
#define MLEN sizeof(struct Mem)
#define FILELEN 50
struct Mem
{
char *mem;
struct Mem *next;
};
struct Node
{
int clen;
int num;
struct Node *nNext;
struct Mem *mNext;
};
void detailedShow(struct Node *head);
void generalShow(struct Node *head);
struct Node* createList();
struct Node* ascSort(struct Node *head,FILE *pf);
struct Node* descSort(struct Node *head,FILE *pf);
int main(int argc,char *argv[])
{
struct Node *h = NULL;