A PHP Error was encountered

Severity: 8192

Message: strpos(): Non-string needles will be interpreted as strings in the future. Use an explicit chr() call to preserve the current behavior

Filename: database/DB_driver.php

Line Number: 1876

A PHP Error was encountered

Severity: 8192

Message: strpos(): Non-string needles will be interpreted as strings in the future. Use an explicit chr() call to preserve the current behavior

Filename: database/DB_driver.php

Line Number: 1876

A PHP Error was encountered

Severity: 8192

Message: strpos(): Non-string needles will be interpreted as strings in the future. Use an explicit chr() call to preserve the current behavior

Filename: database/DB_driver.php

Line Number: 1876

A PHP Error was encountered

Severity: 8192

Message: strpos(): Non-string needles will be interpreted as strings in the future. Use an explicit chr() call to preserve the current behavior

Filename: database/DB_driver.php

Line Number: 1876

A PHP Error was encountered

Severity: 8192

Message: strpos(): Non-string needles will be interpreted as strings in the future. Use an explicit chr() call to preserve the current behavior

Filename: database/DB_driver.php

Line Number: 1876

A PHP Error was encountered

Severity: 8192

Message: strpos(): Non-string needles will be interpreted as strings in the future. Use an explicit chr() call to preserve the current behavior

Filename: database/DB_driver.php

Line Number: 1876

A PHP Error was encountered

Severity: 8192

Message: strpos(): Non-string needles will be interpreted as strings in the future. Use an explicit chr() call to preserve the current behavior

Filename: database/DB_driver.php

Line Number: 1876

A PHP Error was encountered

Severity: 8192

Message: strpos(): Non-string needles will be interpreted as strings in the future. Use an explicit chr() call to preserve the current behavior

Filename: database/DB_driver.php

Line Number: 1876

A PHP Error was encountered

Severity: 8192

Message: strpos(): Non-string needles will be interpreted as strings in the future. Use an explicit chr() call to preserve the current behavior

Filename: database/DB_driver.php

Line Number: 1876

A PHP Error was encountered

Severity: 8192

Message: strpos(): Non-string needles will be interpreted as strings in the future. Use an explicit chr() call to preserve the current behavior

Filename: database/DB_driver.php

Line Number: 1876

A PHP Error was encountered

Severity: 8192

Message: Function create_function() is deprecated

Filename: geshi/geshi.php

Line Number: 4751

A PHP Error was encountered

Severity: 8192

Message: strpos(): Non-string needles will be interpreted as strings in the future. Use an explicit chr() call to preserve the current behavior

Filename: database/DB_driver.php

Line Number: 1876

A PHP Error was encountered

Severity: 8192

Message: strpos(): Non-string needles will be interpreted as strings in the future. Use an explicit chr() call to preserve the current behavior

Filename: database/DB_driver.php

Line Number: 1876

A PHP Error was encountered

Severity: 8192

Message: strpos(): Non-string needles will be interpreted as strings in the future. Use an explicit chr() call to preserve the current behavior

Filename: database/DB_driver.php

Line Number: 1876

A PHP Error was encountered

Severity: 8192

Message: strpos(): Non-string needles will be interpreted as strings in the future. Use an explicit chr() call to preserve the current behavior

Filename: database/DB_driver.php

Line Number: 1876

A PHP Error was encountered

Severity: 8192

Message: strpos(): Non-string needles will be interpreted as strings in the future. Use an explicit chr() call to preserve the current behavior

Filename: database/DB_driver.php

Line Number: 1876

Routine - mcpaste

Routine

Von MC, 10 Jahre vorher, geschrieben in C, aufgerufen 1'600 mal.
URL https://mcpaste.de/view/1a12a6cd Einbetten
Paste herunterladen oder Rohtext anzeigen
  1. // Programmrahmen zur Aufgabe Termin5
  2. // Aufgabe 1
  3. //************************************
  4. //
  5. // von: Manfred Pester
  6. // vom: 06. August 2003
  7. // letzte Änderung:    30. November 2004
  8. // von: Manfred Pester
  9. // #include "ser_io.S"
  10.  
  11.  
  12. void routine(int, char *);
  13.  
  14.  
  15. int main(void)
  16. {
  17.         char i;
  18. // Serielle initialisieren  
  19.         inits();
  20.         init_ser();
  21. // CR und LF auf das Terminal ausgeben
  22. //      putc('A');
  23.         putc (0xd);
  24.         putc (0xa);
  25. // ein Zeichen von der seriellen abholen       
  26. //      i=getc();
  27. //      putc(i);
  28. // String ausgeben*/
  29.         char arr[12];
  30.         routine(0x80000003, arr);
  31.         puts(arr);
  32.        
  33.         return 0;
  34. }
  35.  
  36. void routine(int i, char * arr)
  37. {
  38.         if(i==0)
  39.         {
  40.                 arr[0]='0';
  41.                 arr[1]= 0 ;
  42.                 return;
  43.         }
  44.         int count;
  45.         int tmpi;
  46.         tmpi = i;
  47.         count = 0;
  48.         char cache;
  49.         int negative;
  50.         negative = 0;
  51.         if(i < 0 )      // Ist die Zahl negativ?
  52.         {
  53.                 negative = 1;
  54.                 tmpi = tmpi * -1;
  55.                 i = i * -1;
  56.         }
  57.         while(tmpi > 0) // wie viele Stellen hat unsere Zahl?
  58.         {
  59.                 tmpi = tmpi / 10;
  60.                 count++;
  61.         }
  62.         if(negative == 1)       // Wenn sie negativ ist, eine Stelle mehr, an Stelle 0 kommt das -
  63.         {
  64.         count++;
  65.         //chr[0] = '-';
  66.         }
  67.         int tmpcount;
  68.         tmpcount = count + 1;
  69.         char chr[tmpcount];     // Array erstellen (+1 für 0 an die ende)
  70.         chr[count] = 0;
  71.         if(negative == 1)       // Wenn sie negativ ist, eine Stelle mehr, an Stelle 0 kommt das -
  72.         {
  73.         chr[0] = '-';
  74.         }
  75.  
  76.         int j;
  77.         j= count - 1;
  78.         for(j;j-negative>=0;j--)        // Achtung Achtung bei negativen Zahlen hier eine Veränderung! oder so...
  79.         {
  80.                 cache = i%10;   // Das hinterste Zeichen isolieren
  81.                 i = i/10;       // Die Nächste Stelle nach ganz rechts
  82.                 chr[j] = cache + '0'; // und an die letzte Stelle des Arrays schreiben
  83.         }      
  84.         j=0;
  85.         for(j;j<11;j++)
  86.         {
  87.                 arr[j] = chr[j];
  88.         }
  89. }
  90.  

Antwort auf "Routine"

Hier kannst Du auf den Paste von oben antworten

A PHP Error was encountered

Severity: 8192

Message: strpos(): Non-string needles will be interpreted as strings in the future. Use an explicit chr() call to preserve the current behavior

Filename: database/DB_driver.php

Line Number: 1876