Zum Inhalt springen
View in the app

A better way to browse. Learn more.

Fachinformatiker.de

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Empfohlene Antworten

Veröffentlicht

Moin Moin zusammen :),

da ich gerade an einer Stelle in meinem Programm wo ich nun mit time.h zusammen arbeiten muss. Es soll eine Zeitdifferenz die zwischen einer Operation vergeht berechnet werden.

Momentan sieht der Part so aus:


[B]#include <time.h>

time_t stopuhr1;

time_t stopuhr2;[/B]


    if (choice == 1){ 

       f.open("Bench_Dump.txt", ios::out);

       cout << "Wie Gross soll die Datei werden?! (in MB)" <<endl;

       cin >> length_choice;

       size = length_choice * 1024000;

       length_choice = (length_choice * 1024000)/4;

       system ("cls");

       cout << "Dieser Vorgang kann eine ganze Zeit dauern"<<endl;

       cout << "Fuehre Operation aus:"<<endl;

       [B]time(&stopuhr1);[/B]

       for (i = 0; i<length_choice; i++){

           f << "9999";

       }

       [B]time(&stopuhr2);[/B]

[B]       int difftime (time_t stoppuhr1, time_t stoppuhr2);

       cout << difftime(time_t stopuhr1, time_t stopuhr2); <-- ?[/B] 

       f.close();
Jetzt meine Frage: Was stimmt bei meiner Ausgabe nicht?! Denn mein DevCpp 4.9.9.2 gibt mir ständig folgende Fehlermeldung aus:
expected primary-expression before "stopuhr1" 

Ich weis das er vor dem stopuhr1 & 2 noch einen primären Ausdruck von mir will aber wie soll der aussehen?!

Ich hoffe ihr könnt mir da helfen :).

so long

DeMon

Hehe Klasse Danke funktioniert^^...

Manchmal kann die Welt so einfach sein xD.

so long und einen angenehmen (Arbeits) Freitag

DeMon

Erstelle ein Konto oder melde dich an, um einen Kommentar zu schreiben.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.