Ò׽ؽØÍ¼Èí¼þ¡¢µ¥Îļþ¡¢Ãâ°²×°¡¢´¿ÂÌÉ«¡¢½ö160KB

´ÓÎļþ¶ÁC´®µÄÎÊÌâ

¶¨ÒåÁË

ifstream fin("in.txt");

±ÈÈçÎļþÊ×ÐÐÊÇÒ»¸öÊý×Ö£¬µÚ¶þÐÐÊÇÒ»´®×Ö·û¡£

int M;
char* str;

fin>>M;
fin>>str;

M¿ÉÒÔ¶Á³öÀ´£¬str×ÜÊÇÎÞ·¨¶ÁÈ¡£¬¾Í±¨´íÁË¡£

Èç¹û²»¶ÁM£¬Ò»¿ªÊ¼¾ÍÊǶÁ×Ö·û´®µÄ»°Ò²¿ÉÒÔ£¬µ«ÏȶÁÒ»¸öÕûÐÍÔÙ¶Á×Ö·û´®¾Í²»ÐÐÁË¡£

ÎªÊ²Ã´ÄØ
strÄãµÃÏÈ·ÖÅäÄÚ´æ¡£

ÄãµÄstrûÓÐÉêÇë¿Õ¼ä¡£
ÊÔÊÔchar* str;
str=new char[100];
fin>>M;
fin>>str;
delete []str;

¹À¼ÆÊǣͺóÃæ¸úÁ˿ոñ£¬ÄãÖ»¶Á³öÀ´Ò»¸ö¿Õ¸ñ¡£¡£

·ÖÅäÄÚ´æ
»òÕßÄã¿ÉÒÔÓÃ
string str;
fin>>str;

¿ÉÊÇÎÒÎÞÂÛÊÇÓÃnew char[]»¹ÊÇÓÃmalloc·ÖÅ䣬ÔËÐеÄʱºò¾Í»á³öÏÖ

DAMAGE: after Normal block (#157) at 0x00384FB8

Èç¹ûÊÇûÓзÖÅäÄÚ´æµÄ»°£¬ÎªÊ²Ã´Ò»¿ªÊ¼¾Í¶Á×Ö·û´®¾Í¿ÉÒÔ£¬¶øÏȶÁÕûÐÍÔÙ¶Á×Ö·û´®¾Í²»ÐÐÄØ


Ïà¹ØÎÊ´ð£º

ΪʲôCдDLLÎļþC¡¢PBÄܵ÷ÓÃVB²»Äܵ÷ÓÃ

ΪʲôCдµÄDLLÎļþC¡¢PBÄܵ÷ÓÃVB²»Äܵ÷Óã¿
VBÀïΪʲôÓеÄDLLÖ±½Óͨ¹ýÒýÓÿÉÒÔʹÓã¿ÓеÄÐèҪͨ¹ýdeclareÉêÃ÷Íⲿº¯Êý£¿ÕâЩDLLÓÐʲô²î±ð£¿

1¡¢ÎªÊ²Ã´PBÄÜͨ¹ýDECLAREÉùÃ÷¶øVB²»ÐУ¿
2¡¢Èç¹ûÕâ¸ödllÖÐµÄ ......

c/c++ÿÌõÖ¸ÁîºÍº¯ÊýµÄÖ´ÐÐʱ¼äÊǶàÉÙ£¿

ÏëÖªµÀÿÌõÖ¸Áî»òº¯ÊýµÄϵͳÏûºÄ¡£±ÈÈçϵͳִÐÐint a=0£»µÄ¿ªÏúÊǶàÉÙ¡£ÓÐûÓÐÀàËÆµÄÎĵµÖ®ÀàµÄ¡£²»ÒªºÍÎÒ˵ÓÃʲôclock()º¯ÊýÀ´²âÊÔ¡£ÎÒÏëÒªÏà¹Ø×ܽáºÃµÄÎĵµ
ÏÈ·´»ã±à,È»ºóÄÃ×ÅcpuµÄÖ¸ÁîÊÖ²á²éÿÌõÖ¸ÁîµÄʱ¼äÖÜÆÚ ......

ÄϾ© ÖÐÐË C³ÌÐòÔ±ÕÐÆ¸

¹¤×÷ÄÚÈÝ Ñз¢

×ʸñÒªÇó£º
211ºÍÖØµãԺУ±¾¿Æ 3Ä깤×÷¾­Ñé
211ºÍÖØµãԺУ˶ʿ 1Ä깤×÷¾­Ñé

ÆÕͨԺУÔÚ¹¤×÷ÄêÏÞÉϸ÷¼Ó1Äê


ÓÐͨÐÅÏà¹Ø¿ª·¢¾­ÑéÕßÓÅÏÈ£¬µ±È»C/C++ »ù´¡ÒªÔúʵ

à ......

Ò»¸ö·Ç³£¼òµ¥µÄC³ÌÐòµÄÔËÐнá¹û

#include <stdio.h>
main()
{
int a,b,sum;
a=1;b=2;
sum=a+b;
printf("sum is %d\n");
}


½á¹ûÊÇ£º2367460

Ϊʲô£¿
printf("sum is %d\n", ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØÍ¼ | ¸ÓICP±¸09004571ºÅ