Re: conversion from 'double' to 'unsigned int"
- From: David Wilkinson <no-reply@xxxxxxxxxxxx>
- Date: Thu, 23 Mar 2006 09:14:29 -0500
chauhan.alok wrote:
hi
I am a beginner to vc++.
I am opening a file("c:\Mydoc.doc") and reading data from it and after
that i just want to write data of 1.2 MB part from first
file("c:\Mydoc.doc") to New file("c:\Newdoc1.doc") and remaining to
other file("c;\Newdoc2.doc"). Code is Giving warning .
Pls Help me How these waring can be removed?
Code is:
double dSplitsize,dNumBytes;
FILE * oFile , * sFile;
int intnumr;
oFile = fopen ("c:\Mydoc.doc", "rb");
sFile = fopen ("c:\Newdoc1.doc" , "wb" ); dSplitsize=1.2f;
dNumBytes= dSplitsize*1024*1024;
intnumr= fread (buff1,sizeof(char),dNumBytes,oFile);//warning c4244:
intnumw= fwrite(buff1,sizeof(char),dNumBytes,sFile);//warning c4244:
warning C4244: 'argument' : conversion from 'double' to 'unsigned int',
possible loss of data.
Thanks in advance
alok singh chauhan
--
chauhan.alok
------------------------------------------------------------------------
Posted via http://www.codecomments.com
------------------------------------------------------------------------
alok:
You have to cast dNumBytes to unsigned int to get rid of the warning.
David Wilkinson
.
- References:
- conversion from 'double' to 'unsigned int"
- From: chauhan . alok
- conversion from 'double' to 'unsigned int"
- Prev by Date: Re: form loading speed
- Next by Date: VC8 GDI+ dll in VC6
- Previous by thread: Re: conversion from 'double' to 'unsigned int"
- Next by thread: Hidding property in UserControl
- Index(es):