|
How about:
return file_size/1024; ?
|
|
|
|
|
No, that would be a Kibibyte.
|
|
|
|
|
Are you kidding??
If not, my suggestion would be:
Go back to first grade and start all over again.
|
|
|
|
|
Do you know bytes and kilobytes are simply related, don't you?
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
|
|
|
|
|
CPallini wrote: kilobytes
Kilo is actually metric and means 1000, not 1024.
|
|
|
|
|
I know but:
(1) It is a controversial point [^](do you manufacture hard disks?).
(2) It has no releveance on my statement validity.
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
|
|
|
|
|
I was just stating how I interpret the term "kilo", not how the HD manufacturers abuse it for their marketing.
Interesting article on Wikipedia, by the way. I think these new IEC (kibi, mebi ) and Jedec standards are just idiotic. They should simply stick with KB/KByte, MB/MByte.
|
|
|
|
|
Do you really need to open the file and seek to end to get the size? Why directory informations are for then??
|
|
|
|
|
Why you dont use of CFile::GetLength or GetFileAttributesEx if you dont like to use of them so I tell you a secret that is on the c++ and its:StrFormatByteSizeA .
|
|
|
|
|
http://www.mathematische-basteleien.de/somacube.htm
i am searching about soma cube.
and above site show Full source about soma by c++.
but i can't understand the numbers~~
do you know what mean this?
Loesung Nr: 1
000 100 000 011 000 000 000
000 000 000 001 110 000 000
000 000 011 000 100 000 000
000 100 000 001 000 010 000
000 110 001 000 000 000 000
000 000 001 000 000 000 110
000 000 000 000 000 111 000
111 000 000 000 000 000 000
100 000 000 000 000 000 011
firstly, i am sorry, i am from korea.
and i am not good in wriitting english so please understand~
Thank you everyone~
|
|
|
|
|
I don't know what "soma" is. But those numbers seem to be a group of "Binary" codes and that's all ...
|
|
|
|
|
I checked out the link you gave.
I am still not very clear what soma cube is
The numbers above probably represent a matrix based notation of the solution.
I don't think c/c++ programmers can help you understand what represents what here.
It all depends on the program which uses the above matrix.
So i don't think this is the right forum for this. Maybe some place which deal with maths.
But if u want some guesses:
The site mentions the numbers represents 3 separate solution to whatever soma cube is.
They come in set of 3 rows(horizontal) of 7 columns(vertical) each.
In your post you seem to have clubbed the first two sets together, they are separate.
Each values are 3 bit fields (eg 111,110). Each bit probably represents a connection/cubelet/point in X,Y and Z axis.
Figure the rest out , best of luck
only dead fish swim with the stream
|
|
|
|
|
A component of my project is ready, and now i want it to communicate with some administrator(i.e. another component of my project) on the network. But in the beginning, i havn't included the Socket support (while creating new project thro the wizard). How can i add the socket support now and use the CSocket class in my project ...
plz help ...
|
|
|
|
|
You need to add following line only,
#include <afxsock.h> br mode="hold" />and before using any socket api, make sure you have called following function(Ideally in Initinstance),
AfxSocketInit();
Prasad
MS MVP - VC++
|
|
|
|
|
|
ramana.g wrote: Before using CSocket read this...
http://tangentsoft.net/wskfaq/articles/csocket.html[^]
okay....
i read it ....
but ways the alternative API ... ?
the page give a link to another with a library with its cost !
plz tell me some better solution, i simply want my one component(or program) to communicate with the other (like send string or even file).
plz help ...
|
|
|
|
|
Use WinSock API (Win32APIs), and write some wrapper classes around SOCKET handle. Use a worker thread to receive data, Parse received data and frame the MESSAGE, which you use to communicate over network.
MESSAGE can be something like...
struct MESSAGE{
int nMsgId; //To describe data
BOOL boolFlag; //Req / Res
BYTE *pData; //Actual Data
//Some more fields depending on your requirement
...
...
};
i think this is enough to start with. You can explore and learn as you progress.
|
|
|
|
|
tina- wrote: okay....
i read it ....
but ways the alternative API ... ?
How about CAsyncSocket as an alternative to CSocket? It is better suited for event based applications in my opinion.
|
|
|
|
|
Is there any Add-in for Visual Studio to see contents of HDC, HBitmaps, etc. in MFC?
is there any other add in or way to get this functionality?, i found GDI watch but it doesn´t work here.
I need something like that to work on. Thanks
|
|
|
|
|
|
I currently ran into a problem.
It goes like this:
I do some math here
__x=Cam.front.x*tmp*tan(Cam.Tx)+Cam.right.x*tmp*tan(Cam.Ty);
__y=Cam.front.y*tmp*tan(Cam.Tx)+Cam.right.y*tmp*tan(Cam.Ty);
all fine and well .. my 2 variables are what were supposed to be, but when i try to assign them to a structure with more floats , all floats inside ( donno if realy ALL , but looked at some) become -1.#IND000
Anyone knows what could couse this thing ( and a solution wouldnt hurt either )
Edit:
floats that gets messed up : variables used in expresion ( Cam.front , Cam.right ) and the variable I asign the __x , __y inside the structure ( was Cam.dir)
modified on Saturday, May 24, 2008 5:00 PM
|
|
|
|
|
shaderx wrote: but when i try to assign them to a structure with more floats
struct or union?
Please post more code, so that we might be able to help you. Anyway see some blindfold suggestions.
1) Check the watch window for wrong watch expressions. http://www.codeproject.com/Feature/SubtleBugs.aspx?fid=343280&fr=26&select=2542205#xx2542205xx[^]
2) Make sure the optimizations are turned off.
3) Latest Visual Studio service pack installed? (Poor man's bugfix)
4) Try clean and rebuild. (Poor man's bugfix)
Regards,
Jijo.
_____________________________________________________
http://weseetips.com[ ^] Visual C++ tips and tricks. Updated daily.
|
|
|
|
|
Nevermind, think i found the problem.
modified on Sunday, May 25, 2008 4:10 AM
|
|
|
|
|
You did? Let us know what was it. Something interesting?
_____________________________________________________
http://weseetips.com[ ^] Visual C++ tips and tricks. Updated daily.
|
|
|
|
|
was part my fault, a division by 0 that caused that , but its still wierd cose it works if i dont assing the value , but if i do , its messed up.
|
|
|
|