• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C++ InitList函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C++中InitList函数的典型用法代码示例。如果您正苦于以下问题:C++ InitList函数的具体用法?C++ InitList怎么用?C++ InitList使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了InitList函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。

示例1: main

int main(int argc, char *argv[])
{
  int i;

  InitList(&filelist);
  if (argc == 1)
    copyfile(stdin);
  else
  {
    for (i = 1; i < argc; i++)
      addfile(argv[i]);
    WalkList(&filelist, (WordFnPtr)putfile, 0);
  }
  return 0;
}
开发者ID:jamjr,项目名称:Helios-NG,代码行数:15,代码来源:tiddles.c


示例2: initFunction

//inicializace pole funkci
tChyba initFunction()
{
	funcSize = 10;
	currFuncSize = 0;
	func = (TFunction*)malloc(sizeof(TFunction)*funcSize);
	if( !func ){
		return S_INTERNI_CHYBA;
	}
	for (int i = 0; i < funcSize; ++i){
		func[i].key = NULL;
		InitList( &(func[i].instrList) );
		func[i].table = NULL;
	}
	return S_BEZ_CHYB;
}
开发者ID:adamVass,项目名称:IFJ,代码行数:16,代码来源:frame.c


示例3: InitHashTable

void InitHashTable(hashTablePrivate **htptr, int M,
                   int valueSize, void (*print)(), double (*equal)(),
                   unsigned long long int (*hashFun)(), void (*destroyValue)()) {

    *htptr = malloc(sizeof(hashTablePrivate));
    hashTablePrivate *ht = *htptr;
    ht->table = malloc(sizeof(List)*M);
    int i;
    for (i = 0; i < M; ++i) {

        InitList(&ht->table[i], valueSize, print, equal, destroyValue);
    }
    ht->hashFun = hashFun;
    ht->M = M;
    ht->size=0;
}
开发者ID:sergafts,项目名称:softdevalg,代码行数:16,代码来源:hashTable.c


示例4: main

int main()
{	DLinkList *L;
	int choice;
	InitList(L);
	int length;
	ElemType *a;
	length = readInput(a);
	CreateList(L , a ,length);
	DispList(L);
	while(1 == scanf("%d",&choice))
	{	LocateNode(L,choice);
		DispList(L);
	}
	
	return 0;
}
开发者ID:halfopen,项目名称:data_struct,代码行数:16,代码来源:2_5.cpp


示例5: CreatPolyn

Status CreatPolyn(polynomail *p, int m) {
	int i, expn;
	double coef;
	ElemType e;
	Link *s;
	if (InitList(p) == ERROR)return ERROR;
	for (i = 0; i < m; i++) {
		printf("请输入第%d项的系数和指数:", i + 1);
		scanf("%lf%d", &coef, &expn);
		if (SetPolyn(&e, coef, expn) == ERROR)return ERROR;	//输入数据,形成数据域
		if (MakeNode(&s, e) == ERROR)return ERROR;			//包装进一个结点
		if (Append(p, s) == ERROR)return ERROR;				//将结点插入链表尾
	}
	SortPolyn(p);											//再慢慢排序
	return OK;
}
开发者ID:TianLanhe,项目名称:Data_Structure,代码行数:16,代码来源:Polynomail.c


示例6: Update

void CDashArrayDlg::OnBnClickedButtonrmv()
{
	if ( m_pDashArray == NULL )
	{
		return;
	}
	Update();
	if( m_iIndex == 1 )
	{
		::MessageBox(AfxGetApp()->GetMainWnd()->m_hWnd , "数组个数最少为1!" , "警告" ,MB_OK);
		return;
	}

	m_pDashArray->RemoveDash( m_iIndex - 1 );
	m_pDashArray->SetDashGroupCount(m_pDashArray->GetDashGroupCount() - 1);
	InitList();
}
开发者ID:lozpeng,项目名称:applesales,代码行数:17,代码来源:DashArrayDlg.cpp


示例7: Algo10_11_main

 void Algo10_11_main()
 {
   RedType d[N]={{278,1},{109,2},{63,3},{930,4},{589,5},{184,6},{505,7},{269,8},{8,9},{83,10}};
   SLList l;
   int *adr;
   InitList(l,d,N);
   printf("排序前(next域还没赋值):\n");
   print(l);
   RadixSort(l);
   printf("排序后(静态链表):\n");
   print(l);
   adr=(int*)malloc((l.recnum)*sizeof(int));
   Sort(l,adr);
   Rearrange(l,adr);
   printf("排序后(重排记录):\n");
   print(l);
 }
开发者ID:cjpthree,项目名称:datastructure_vs,代码行数:17,代码来源:alg10-11.cpp


示例8: main

int main()
{
    LinkList L;
    InitList(&L);
    Link test=NULL;
    ElemType array[10] = {10,9,8,7,6,5,4,3,2,1};
    /*ElemType array[10] = {0,9,8,7,6,5,4,3,2,1};*/

    CreateListByArray(array,sizeof(array)/sizeof(ElemType),&L,&InsFirst);
    printf("Length= %d\n",ListLength(L));
    LocatePos(L,9,&test);
    printf("第9个节点数据为%d\n",test->data) ;
    printf("%s\n","------------------------------------") ;
    ListTraverse(L,&Myvist);
    DestroyList(&L);
    return 0;
}
开发者ID:ourzizz,项目名称:learnc,代码行数:17,代码来源:listhw.c


示例9: AddToMap

int AddToMap(Map* mp, char* key, void* value) {
	if (!mp) return 0;
	List* ls = FindInHashTable(mp->tb,key);
	if (!ls) {
		ls = InitList();
		if (!InsertIntoHashTable(mp->tb,key,ls)) {
			printf("Warning(Map): cannot insert %s into hash table!\n",key);
			return 0;
		}
		mp->size++;
	}
	if (!AppendToList(ls,value)) {
		printf("Warning(Map): cannot append to list!\n");
		return 0;
	}
	return 1;
}
开发者ID:jingdao,项目名称:CodeBrowser,代码行数:17,代码来源:Map.c


示例10: Test1

void Test1()//PushBack   PopBack
{
	PSListNode pHead = NULL;
	InitList(&pHead);
	PushBack(&pHead,0);
	PushBack(&pHead,1);
	PushBack(&pHead,2);
	PushBack(&pHead,3);
	PushBack(&pHead,4);

	PrintList(&pHead);

	PopBack(&pHead);
	PopBack(&pHead);

	PrintList(&pHead);
}
开发者ID:XHXaiXXR,项目名称:code,代码行数:17,代码来源:test.c


示例11: InitTimeCtrl

void CCardopenConsumeView::OnInitialUpdate()
{
	CIBAFormView::OnInitialUpdate();

	m_STATICResult.SetFont(&m_Font);
	m_STATICResult.SetWindowText(_T(""));

	InitTimeCtrl();

	InitDate();

	InitList();

	GetDlgItem(IDC_BUTTON_QUERY)->SetFocus();

	// 2011/12/28-8236-gxx: 自动查询一次
	OnBnClickedButtonQuery();
}
开发者ID:layerfsd,项目名称:PersonalIBA,代码行数:18,代码来源:CardopenConsumeDlg.cpp


示例12: CreateListByTail

/********************************************************************
	Method:    CreateListByTail
	Parameter: 单链表,元素个数
	Returns:

	Purpose:   尾插法建立单链表

*********************************************************************/
bool CreateListByTail(LinkList &L, int num)
{
    InitList(L);

    Node *tail = L;

    for (int i = 0; i < num; i++)
    {
        Node *s = (Node *)malloc(sizeof(Node));
        s->e.data = i + 1;
        s->next = NULL;

        tail->next = s;
        tail = s;
    }

    return true;
}
开发者ID:githubdlj,项目名称:DataStruct,代码行数:26,代码来源:LinkList.cpp


示例13: NewPermanent

Permanent* NewPermanent(MTGCard* source,MTGPlayer* own) {
    Permanent* p = (Permanent*) calloc(1,sizeof(Permanent));
    p->name = source->name;
    p->subtypes = source->subtypes;
    p->abilities = ListCopy(source->abilities);
    if (source->subtypes.is_planeswalker)
        p->loyalty = source->loyalty;
    else if (source->subtypes.is_creature){
        p->power = p->sourcePower = source->power;
        p->toughness = p->sourceToughness = source->toughness;
        p->has_summoning_sickness = true;
    }
    p->equipment = InitList();
    p->source = source;
    p->owner = own;
    p->controller = own;
    return p;
}
开发者ID:jingdao,项目名称:mtg,代码行数:18,代码来源:MTGPlayer.c


示例14: CreateListByHead

/********************************************************************
	Method:    CreateListByHead
	Parameter: 单链表, 元素个数
	Returns:

	Purpose:   头插法建立单链表

*********************************************************************/
bool CreateListByHead(LinkList &L, int num)
{
    InitList(L);

    for (int i = 0; i < num; i++)
    {
        //	建立节点
        Node *s = (Node *)malloc(sizeof(Node));
        s->e.data = i + 1;
        s->next = NULL;

        //	插入
        s->next = L->next;
        L->next = s;
    }

    return true;
}
开发者ID:githubdlj,项目名称:DataStruct,代码行数:26,代码来源:LinkList.cpp


示例15: InitList

/**
 * @brief Initialize the dialog.
 */
BOOL PluginsListDlg::OnInitDialog()
{
	theApp.TranslateDialog(m_hWnd);
	CDialog::OnInitDialog();
	
	InitList();
	AddPlugins();

	BOOL pluginsEnabled = GetOptionsMgr()->GetBool(OPT_PLUGINS_ENABLED);
	if (pluginsEnabled)
	{
		CButton *btn = (CButton *)GetDlgItem(IDC_PLUGINS_ENABLE);
		btn->SetCheck(BST_CHECKED);
	}

	return FALSE;  // return TRUE unless you set the focus to a control
	              // EXCEPTION: OCX Property Pages should return FALSE
}
开发者ID:YueLinHo,项目名称:WinMerge,代码行数:21,代码来源:PluginsListDlg.cpp


示例16: QWidget

qtDLGPEEditor::qtDLGPEEditor(clsPEManager *PEManager,QWidget *parent, Qt::WFlags flags, int PID, std::wstring FileName)
	: QWidget(parent,flags)
{
	setupUi(this);
	
	this->setStyleSheet(clsHelperClass::LoadStyleSheet());
	this->setLayout(verticalLayout);
	this->setAttribute(Qt::WA_DeleteOnClose,true);

	connect(treePE,SIGNAL(customContextMenuRequested(QPoint)),this,SLOT(OnCustomContextMenu(QPoint)));
	connect(new QShortcut(Qt::Key_Escape,this),SIGNAL(activated()),this,SLOT(close()));

	m_processID = PID;
	m_pEManager = PEManager;
	
	if(m_pEManager != NULL)
	{	
		if(FileName.length() > 0)
			m_currentFile = FileName;
		else
			m_currentFile = m_pEManager->getFilenameFromPID(m_processID);

		if(m_processID == -1)
			m_pEManager->OpenFile(m_currentFile);

		if(m_currentFile.length() <= 0) 
		{
			QMessageBox::critical(this,"Nanomite","Could not load File!",QMessageBox::Ok,QMessageBox::Ok);

			close();
		}

		this->setWindowTitle(QString("[Nanomite] - PEEditor - FileName: %1").arg(QString::fromStdWString(m_currentFile)));

		InitList();
		LoadPEView();
	}
	else
	{
		QMessageBox::critical(this,"Nanomite","Could not load File!",QMessageBox::Ok,QMessageBox::Ok);

		close();
	}
}
开发者ID:blaquee,项目名称:Nanomite,代码行数:44,代码来源:qtDLGPEEditor.cpp


示例17: main

int main(int argc, const char * argv[]) {

    LinkList list, *L;
    Node *t;
    L = &list;
    
    InitList(L);
    ListInsert(L, 1, 12);
    ListInsert(L, 2, 13);
    ListInsert(L, 1, 14);
    ListInsert(L, 1, 15);
    ListInsert(L, 1, 16);
    ListInsert(L, 3, 17);
    t = LocateElem(L, 14);
    printf("%d \n", t->data);
    VisitList(L);
    DestroyList(L);
    return 0;
}
开发者ID:ScorpioNeal,项目名称:Algorithm,代码行数:19,代码来源:线性表的链式存储.c


示例18: main

int main(){
	DuLinkList L;
	int i, n;

	InitList(&L);

	printf("please enter an integer:");
	scanf("%d", &n);
	printf("\n");

	Caesar(&L, n);

	for(i = 0; i< 26; i++){
		L = L->next;
		printf("%c", L->data);
	}
	printf("\n");
	return 0;
}
开发者ID:ginlee,项目名称:cpp,代码行数:19,代码来源:loop.cpp


示例19: InitList

BOOL CDLGSetFace::OnInitDialog() 
{
	CDialog::OnInitDialog();

	// TODO: Add extra initialization here

	//初始化列表
	InitList();

	m_b_ok.LoadBitmaps(IDB_OK_BUTTON,IDB_OK_BUTTON_MOVE,NULL,NULL);
	m_b_ok.SizeToContent();		//自适应图片大小

	m_b_cancel.LoadBitmaps(IDB_CANCEL_BUTTON,IDB_CANCEL_BUTTON_MOVE,NULL,NULL);
	m_b_cancel.SizeToContent();		//自适应图片大小


	return TRUE;  // return TRUE unless you set the focus to a control
	// EXCEPTION: OCX Property Pages should return FALSE
}
开发者ID:dulton,项目名称:brpj,代码行数:19,代码来源:DLGSetFace.cpp


示例20: main

int main(int argc, char *argv[])
{
  int sctcp;
  char hostname[80] = "";
  struct sockaddr_in SC_link = { 0 };
  int server_port=8000;
  int childPid=0;
  static LList userlist;
  InitList(&userlist);
  pthread_t id;
  int ret;

  printf("Server is starting\n");
  sctcp=tcpSocket();	//client-server comunicate with tcp
  Setsockopt(sctcp);		//set SO_REUSEADDR,SO_LINGER opt
  GetHostName(hostname, sizeof(hostname));
  CreateSockAddr(hostname,&SC_link,server_port);
  Bind(sctcp, (struct sockaddr *) &SC_link,sizeof(SC_link));
  Listen(sctcp);
  printf("Server started successfully and it is ready now\n");
  printf("Now entered listening mode\n");
  for (;;)
  {
    struct sockaddr_in client_sockaddr = { 0 };
    int cli_socket, cli_sock2,clientLength = sizeof(client_sockaddr);
    (void) memset(&client_sockaddr, 0, sizeof(client_sockaddr));
    cli_socket = Accept(sctcp,(struct sockaddr *) &client_sockaddr, &clientLength);
    if (-1 == cli_socket)
    {
      perror("accept()");
    }
    threadargs newargs;
    newargs.sock=cli_socket;
    newargs.list=&userlist;
    //      accept_cli(&newargs);
    ret=pthread_create(&id,NULL,(void *)accept_cli,&newargs);
    if(ret!=0)
      perror("thread create error");
  }


  return EXIT_SUCCESS;
}
开发者ID:xhbang,项目名称:network-exercise,代码行数:43,代码来源:server.c



注:本文中的InitList函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ InitLog函数代码示例发布时间:2022-05-30
下一篇:
C++ InitKeyboardManager函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap