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

Hallo liebe Community,

bin neu hier und möcht mich gleich mal beteiligen - habe zwar kein wirkliches Problem aber eine Frage.



#include <stdio.h>


int main() {


	[COLOR="Red"]double[/COLOR] a=123.456,b=76.543;			


	printf("a + b = %f\n\n", a+;		


	return 0;

}[/code]

Dies ist nur ein Beispielprogramm in dem ich mit Gleitpunktzahlen herumexperimentiert hab. Ich hatte erst den Datentyp float, doch da spuckte er 2 Warnungen aus. Frage mich aber warum, float ist kleiner als double und kann 6 stellen wiedergeben. Trotzdem meckert er. Kann mir jemand sagen warum?

Grüße Sythus

Die Warnung:

warning C4305: 'initializing' : Verkuerzung von 'const double' in 'float'

Ich arbeite mit Microstoft Visual c++ 6.0, Windows XP

Die Zahlen 123.456 bzw. 76.543 sind doubles. Willst du ausdrücklich ein float, schreib ein "f" als suffix also:

float a=123.456f, b =76.543f;

Damit sagst du dem Compiler dass du dich nicht verschrieben hast sondern wirklich nur 4 byte belegen willst.

Ist aber auch wieder Compilerabhängig. Also beim MSVS das 'f' angewöhnen, die Warnung ignorieren oder die Warnung deaktivieren.

Ich meine die Warnung selbst, die nicht bei jedem Compiler ausgegeben wird.

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.