Tags: C

Sort by: Date / Title /

  1. 7 months ago by wolvington
    1. #include<stdio.h>
    2. int main()
    3. {
    4. printf("Hola Mundo");
    5. return 0;
    6. }
  2. 10 months ago by yoko
    1. /* pour parcourir une string (ou tout autre conteneur indicé) dans l'ordre inverse */
    2. for (size_t ind = Str.size(); i--;);
  3. 10 months ago by sebclick and saved by 1 other
    Dans un des fichiers c de votre projet :
    
    :make          Lance la compilation du programme et positionne le curseur sur la première erreur s'il y en a une.
    :cnext          Positionne le curseur sur l'erreur suivante.
    :cprevious    Positionne le curseur sur l'erreur précédente.
  4. sponsorised links
  5. 10 months ago by sebclick
    Vim peut indenter automatiquement du code source (c, java, ...)
    
    Sélectionner la partie du code source à traiter en mode visuel (v)
    Appuyer sur la touche =
  6. 10 months ago by moifort
    1. // Declaration socket
    2. WSADATA WSAData;
    3. SOCKET sock;
    4. SOCKADDR_IN sin;       
    5.  
    6. // Initialisation socket
    7. WSAStartup(MAKEWORD(2,0), &WSAData);
    8.  
    9. sin.sin_addr.s_addr= inet_addr("127.0.0.1"); // Adresse IP
    10. sin.sin_family= AF_INET;
    11. sin.sin_port= htons(4001)// Port
    12. sock = socket(AF_INET,SOCK_STREAM,0);
    13. bind(sock, (SOCKADDR *)&sin, sizeof(sin));
    14.  
    15. // Si connection etablie
    16. if (connect(sock, (SOCKADDR *)&sin, sizeof(sin)) == 0)
    17. {
    18. // Declaration socket
    19. WSADATA WSAData;
    20. SOCKET sock;
    21. SOCKADDR_IN sin;       
    22.  
    23. // Initialisation socket
    24. WSAStartup(MAKEWORD(2,0), &WSAData);
    25.  
    26. sin.sin_addr.s_addr     = inet_addr("127.0.0.1"); // Adresse IP
    27. sin.sin_family    = AF_INET;
    28. sin.sin_port        = htons(4001)// Port
    29. sock = socket(AF_INET,SOCK_STREAM,0);
    30. bind(sock, (SOCKADDR *)&sin, sizeof(sin));
    31.  
    32. // Si connection etablie
    33. if (connect(sock, (SOCKADDR *)&sin, sizeof(sin)) == 0)
    34. else
    35.  
    36. // Fin
    37. closesocket(sock);
    38. WSACleanup();
  7. 10 months ago by moifort
    1. // Fonction pour redemarrer Windows avec les MFC
    2.  
    3. void RestartWindows(void)
    4. {
    5.         // Declaration
    6.         HANDLE hToken;
    7.         TOKEN_PRIVILEGES tkp;
    8.  
    9.         // Get a token for this process.
    10.         OpenProcessToken(GetCurrentProcess(), TOKEN_ADJUST_PRIVILEGES | TOKEN_QUERY, &hToken);
    11.  
    12.  
    13.         // Get the LUID for the shutdown privilege. 
    14.         LookupPrivilegeValue(NULL, SE_SHUTDOWN_NAME,&tkp.Privileges[0].Luid);
    15.  
    16.         tkp.PrivilegeCount = 1// one privilege to set   
    17.         tkp.Privileges[0].Attributes = SE_PRIVILEGE_ENABLED;
    18.  
    19.         // Get the shutdown privilege for this process. 
    20.         AdjustTokenPrivileges(hToken, FALSE, &tkp, 0, (PTOKEN_PRIVILEGES)NULL, 0);
    21.  
    22.  
    23.         // Shut down the system and force all applications to close. 
    24.         ExitWindowsEx(EWX_REBOOT| EWX_FORCE, 0);
    25. }

First / Previous / Next / Last / Page 1 of 1 (6 posteets)