C/C++¶àÖÖ·½·¨»ñÈ¡Îļþ´óС
#include <iostream>
#include <io.h>
#include <sys\stat.h>
#include <afx.h>
#define _AFXDLL
using namespace std;
void main()
{
// ´ËÎļþÔÚ¹¤³Ì´ò¿ª×´Ì¬ÏÂΪ²»¿É·ÃÎÊ
char* filepath = "..\\test.ncb";
// ·½·¨Ò»
struct _stat info;
_stat(filepath, &info);
int size = info.st_size;
cout<<size<<endl;
// ·½·¨¶þ
FILE* file = fopen(filepath, "rb");
if (file)
{
int size = filelength(fileno(file));
cout<<size<<endl;
fclose(file);
}
// ·½·¨Èý
CFile cfile;
if (cfile.Open(filepath, CFile::modeRead))
{
int size = cfile.GetLength();
cout<<size<<endl;
}
// ·½·¨ËÄ
HANDLE handle = CreateFile(filepath, FILE_READ_EA, FILE_SHARE_READ, 0, OPEN_EXISTING, 0, 0);
if (handle != INVALID_HANDLE_VALUE)
{
int size = GetFileSize(handle, NULL);
cout<<size<<endl;
Close
Ïà¹ØÎĵµ£º
ÈÕÆÚ£º2009-11-21 10:54:22
±¾½ÚÖ÷Òª²Î¿¼£º
²ÜÀֵġ¶ÔÚEmacsÏÂÓÃC/C++±à³Ì¡·
Íõ´¿ÒµµÄ¡¶Emacs Ò»¸öÇ¿´óµÄƽ̨¡·
emacswiki.org
emcasÄÑѧÒ×Ó㬿ÉÀ©Õ¹ÐÔÇ¿¡£ÓÐÈ˰ÑËýµ±×÷ÐÅÑö£¬ÓÐÈËÈÏΪËûÊÇħ¹í£¡Ñ§Ï°Ê×ÏȼÇס»ù±¾µÄ¼üÅÌ¿ì½Ý¼ü£¬Ñ§»á³£Óòå¼þ£¬ ......
#ifndef _PPC_BOOT_STRING_H_
#define _PPC_BOOT_STRING_H_
#include <stddef.h>
extern char *strcpy(char *dest, const char *src);
extern char *strncpy(char *dest, const char *src, size_t n);
extern char *strcat(char *dest, const char *src);
extern int strcmp(const char *s1, const cha ......
ǰÁ½ÌìÔÚÍøÉÏ¿´µ½¡¶Cר¼Ò±à³Ì¡·Õâ±¾ÊéµÄÆÀ¼Û»¹²»´í£¬¾ÍÈ¥ÊéµêÂòÁËÒ»±¾»ØÀ´Åõ¶Á£¬Ã¿ÌìÍíÉÏ¿´Ò»Ð©¡£Ì½ÌÖµÄÎÊÌâȷʵ±È½ÏÉ¶¼ÔÚÌÖÂÛCÓïÑÔ±¾ÉíµÄÎÊÌâÁË¡£Ìáµ½ÁËCÓïÑÔÖеÄһЩ²»×ã¡£±¾À´ÈÏΪCÓïÑÔÊÇÎÞи¿É»÷µÄ£¬¿É´Ó×÷ÕߵĽǶȿ´À´£¬È·ÊµÓÐЩ²»Í׵ĵط½£¬ÏëÏëÒ²ÊÇ£¬ÄÄÓÐÍêÃÀÎÞȱ¶«Î÷ÄØ¡£Æäʵ×÷ÕßÒ²²¢·ÇÔڱᵠ......
C³ÌÐòÊÇÓÉÒ»×é»òÊDZäÁ¿»òÊǺ¯ÊýµÄÍⲿ¶ÔÏó×é³ÉµÄ¡£ º¯ÊýÊÇÒ»¸ö×ÔÎÒ°üº¬µÄÍê³ÉÒ»¶¨Ïà¹Ø¹¦ÄܵÄÖ´ÐдúÂë¶Î¡£ÏÂÃæÐ¡±àºÍ´ó¼Ò·ÖÏíÏÂCÓïÑÔÖеĺ¯Êý¡£
1. ldexpº¯Êý
ldexpº¯ÊýµÄ¹¦ÄÜÊǼÆËãvalue*2µÄÃÝ£¬ÆäÓ÷¨Îª£ºdouble ldexp(double value, int exp);³ÌÐòʵÀýÈçÏ£º
......
C³ÌÐòÊÇÓÉÒ»×é»òÊDZäÁ¿»òÊǺ¯ÊýµÄÍⲿ¶ÔÏó×é³ÉµÄ¡£ º¯ÊýÊÇÒ»¸ö×ÔÎÒ°üº¬µÄÍê³ÉÒ»¶¨Ïà¹Ø¹¦ÄܵÄÖ´ÐдúÂë¶Î¡£ÏÂÃæÐ¡±àºÍ´ó¼Ò·ÖÏíÏÂCÓïÑÔÖеĺ¯Êý¡£
1. parsfnmº¯Êý
parsfnmº¯ÊýµÄ¹¦ÄÜÊÇ·ÖÎöÎļþÃû£¬ÆäÓ÷¨Îª£ºchar *parsfnm (char *cmdline, struct fcb *fcbptr, ......