コード例 #1
0
void DirMan::DirMan_private::setPath(const std::string &dirPath)
{
    m_dirPathW = Str2WStr(dirPath);
    wchar_t fullPath[MAX_PATH];
    GetFullPathNameW(m_dirPathW.c_str(), MAX_PATH, fullPath, NULL);
    m_dirPathW = fullPath;
    //Force UNIX paths
    std::replace(m_dirPathW.begin(), m_dirPathW.end(), L'\\', L'/');
    m_dirPath = WStr2Str(m_dirPathW);
    delEnd(m_dirPathW, L'/');
    delEnd(m_dirPath, '/');
}
コード例 #2
0
ファイル: doubleLL.c プロジェクト: RudraNilBasu/DS-Lab
int main()
{
	int ch; // choice of the user
	while(1)
	{
		// input of choice
		printf("1.Insert at front\n");
		printf("2.Insert at end\n");
		printf("3.Insert at any position\n");
		printf("4.Delete from front\n");
		printf("5.Delete from rear.\n");
		printf("6.Delete at any position\n");
		printf("7.Display\n");
		printf("8.End\n");
		intd(ch);
		// calling other functions as per the choice
		if(ch==1)
		{
			insFr();
		}
		if(ch==2)
		{
			insEnd();
		}
		if(ch==3)
		{
			insPos();
		}
		if(ch==4)
		{
			delFr();
		}
		if(ch==5)
		{
			delEnd();
		}
		if(ch==6)
		{
			delPos();
		}
		if(ch==7)
		{
			display();
		}
		if(ch==8)
		{
			break;
		}
	}
	return 0;
}
コード例 #3
0
ファイル: iorestricted.cpp プロジェクト: nitb/cs2k15
int main()
{
    char ch , a='y';
    int choice, c, token;
    printf("Enter your choice for which deque operation you want to perform operation \n");
     do
     {
          printf("\n1.Input-restricted deque \n");
          printf("2.output-restricted deque \n");
          printf("\nEnter your choice for the operation : ");
          scanf("%d",&c);
          switch(c)
          {
               case 1:
                    printf("\nDo operation in Input-Restricted c deque\n");
                    printf("1.Insert");
                    printf("\n2.Delete from end");
                    printf("\n3.Delete from begning");
                    printf("\n4.show or display");
                    do
                   {
                   printf("\nEnter your choice for the operation in c deque: ");
                   scanf("%d",&choice);
                   switch(choice)
                   {
                       case 1: insertEnd(token);
                       display();
                       break;
                       case 2: token=delEnd();
                       printf("\nThe token deleted is %d",token);
                       display();
                       break;
                       case 3: token=delStart();
                       printf("\nThe token deleted is %d",token);
                       display();
                       break;
                       case 4: display();
                       break;
                       default:printf("Wrong choice");
                       break;
                   }
                   printf("\nDo you want to continue(y/n) to do operation in input-restricted c deque: ");
                   ch=getch();
                   }
                   while(ch=='y'||ch=='Y');
                   getch();
                   break;

               case 2 :
                   printf("\nDo operation in Output-Restricted c deque\n");
                   printf("1.Insert at the End");
                   printf("\n2.Insert at the begning");
                   printf("\n3.Delete the element");
                   printf("\n4.show or display");
                   do
                   {
                   printf("\nEnter your choice for the operation: ");
                   scanf("%d",&choice);
                   switch(choice)
                       {
                       case 1: insertEnd(token);
                       display();
                       break;
                       case 2: insertStart(token);
                       display();
                       break;
                       case 3: token=delStart();
                       printf("\nThe token deleted is %d",token);
                       display();
                       break;
                       case 4: display();
                       break;
                       default:printf("Wrong choice");
                       break;
                       }
                   printf("\nDo you want to continue(y/n):");
                   ch=getch();
                   }
                   while(ch=='y'||ch=='Y');
                   getch();
                   break ;
          }

     printf("\nDo you want to continue(y/n):");
                   ch=getch();
                   }
                   while(ch=='y'||ch=='Y');
                   getch();
}