,   CyberForum.ru

. - C++

C++ , Taiga 0.2.0 realXtend... http://www.cyberforum.ru/cpp-beginners/thread277154.html
=) , , , ... , , Taiga () ...
C++ , ++ . bool **Madj; int *Visit; int main(){ int NodeCount=3; Visit = new int ; Madj = new bool*; http://www.cyberforum.ru/cpp-beginners/thread277145.html
C++ TC
! N. , , x,y , N=x^2+y^2. 25, 4 3, .. 4^2=16 3^2=9, 16+9=25 =))
C++
. . . - . , .
C++ , http://www.cyberforum.ru/cpp-beginners/thread277121.html
, .
C++ free ! : , delete. , free. #include<stdio.h> #include<stdlib.h> #include<time.h> int size; int *mas; int pos; void _delete(int pos){ pos--;

kravam
   kravam
1513 / 873 / 44
: 04.06.2008
: 5,266
15.04.2011, 21:29     .
C++
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
#include <windows.h>
#include <stdio.h>
 
long int rez= 0;
 
void GetFileList(LPTSTR sPath, LPTSTR sExt, LPTSTR sEXT);
 
int main(){
 
//Ïîñêîëüêó sPath è sExt è sEXT îäè**êîâû âî âñåõ âûçîâ*õ GetFileList, èõ ìîæ*î áûëî áû ñäåë*òü
//ãëîá*ëü*ûìè, *î ÿ ò*ê îñò*âèë. 
//        char sPath[MAX_PATH]= "E:\\Microsoft_Visual_Studio_9.0";
        char sPath[MAX_PATH]= "C:\\";
//        char sPath[MAX_PATH]= "C:\\vso_moio";
//        char sPath[MAX_PATH]= "C:\\vso_moio";
 
//Îáð*òèòü  â*èì**èå ** ð*çìåð ì*ññèâ*!
        char sExt[10]= "exe";
        char sEXT[10]= "EXE";
        GetFileList(sPath, sExt, sEXT);
//Ïîðòèò âñ¸ äåëî: Åñëè ïåðå**ïð*âëÿòü â ô*éë ñ êî*ñîëè, òî ïîëó*÷*åòñÿ, ÷òî â êî*ñîë âåäóò 
//ç*ïèñü äâ* ð*ç*ûõ ïîòîê*- òîò,êîòîðûé *óæå*ò è ýòîò,êîòîðûé ç*ïèñûâ*åò "Äëÿ ïðîäëæå*èÿ **æìèòå ëþáóþ
//êë*âèøó" è ýò* **äïèñü âêëè*èâ*åòñÿ â ñåð¸äêó è ïîðòèò âñ¸ äåëî
      printf("rez= %d\n", rez);
  system ("PAUSE");
}
 
void GetFileList(LPTSTR sPath, LPTSTR sExt, LPTSTR sEXT) {
 
 WIN32_FIND_DATA pFILEDATA;
 
 HANDLE hFile = FindFirstFile(strcat(sPath,"\\*.*"),&pFILEDATA);
 
//!!!!!!!!!!!!!!!!!!!!!!!!!!!!Íåîáõîäèìî èìå**î çäåñü ïðîïèñûâ*òü äëè*ó ïóòè!!!!!!!!!!!!!!!!!!!!!!!
 sPath[strlen(sPath) - strlen(strstr(sPath,"*.*"))] = '\0';
//Åñëè ïðîïèøåì ïîñëå if (ê*ê ïðåäë*ã*åò Þð*), òî òîãä*, åñëè âäðóã **òûê*åìñÿ ** ñèñòåì*óþ äèðåêòîðèþ
// èëè ô*éë, òî FindFirstFile âîçâð*ù*åò -1. Ñëåäîâ*òåëü*î, âñ¸, ÷òî âûïë**ÿåòñÿ ïî óñëîâèþ
//(hFile!=INVALID_HANDLE_VALUE) *å âûîë*èòñÿ è â ÷*ñò*îñòè, *å áóäåò ïîñò*âëå* êî*åö ñòðîêè!
//À ýòî ç**÷èò, ÷òî ïî âûõîäó èç  ðåêóðñèâ*îé ôó*êöèè GetFileList â òîì ìåñòå, ãäå ìû âîññò***âëèâ*åì
//Äëè*ó, î** áóäåò âîññò**îâëå** *åïð*âèëü*î
 if (hFile!=INVALID_HANDLE_VALUE)    {
  char * chBuf;
  //sPath[strlen(sPath) - strlen(strstr(sPath,"*.*"))] = '\0';
  do {
   //Ïðîïóñê*åì . è ..
   if (strlen(pFILEDATA.cFileName) == 1 &&  strchr(pFILEDATA.cFileName,'.') !=NULL)
    if (FindNextFile(hFile,&pFILEDATA) == 0)
      break;
   if (strlen(pFILEDATA.cFileName) == 2 && strstr(pFILEDATA.cFileName,"..") !=NULL)
    if(FindNextFile(hFile,&pFILEDATA) == 0)
      break;
     //Åñëè **øëè äèðåêòîðèþ, ç*ïóñê*åì ïîèñê â *åé ðåêóðñèâ*ûé ïîèñê
   if(pFILEDATA.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) {
     GetFileList(strcat(sPath,pFILEDATA.cFileName), sExt, sEXT);
 
//!!!!!!!!!!!!!!!!!!!!!!!!!!!!!îÁßÇÀÒÅËÜÍ âîñò***âëèâ*òü äëëè*ó ïóòè................................     
     sPath[strlen(sPath) - strlen(pFILEDATA.cFileName)- 1] = '\0';
   }
   else {
    //Ïðîâåðÿåì ** ñîîòâåñòâèå sExt ð*ñøèðå*èÿ pFILEDATA.cFileName
    if((chBuf = strrchr(pFILEDATA.cFileName,'.'))) {
     if(strstr(chBuf + 1,sExt)|| strstr(chBuf + 1,sEXT)) {
      //Åñëè *å áóäåì èñïîëüçîâ*òü CharToOem() òî ** ýêð**å ðóññêèé øðèôò ê*ð*êóëÿìè âûéäåò
      CharToOem(sPath,sPath);
      printf("%s",sPath);
      OemToChar(sPath,sPath);
      CharToOem(pFILEDATA.cFileName,pFILEDATA.cFileName);
      printf("%s\n",pFILEDATA.cFileName);
      rez++;
     }
    }
   }
  }
  while (FindNextFile(hFile,&pFILEDATA));
 }
}
.
 
: 09:19. GMT +3.
- , ,
-
Powered by vBulletin® Version 3.8.9
Copyright ©2000 - 2016, vBulletin Solutions, Inc.
@Mail.ru