´ÓÎļþ¶Á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²»Äܵ÷Óã¿
VBÀïΪʲôÓеÄDLLÖ±½Óͨ¹ýÒýÓÿÉÒÔʹÓã¿ÓеÄÐèҪͨ¹ýdeclareÉêÃ÷Íⲿº¯Êý£¿ÕâЩDLLÓÐʲô²î±ð£¿
1¡¢ÎªÊ²Ã´PBÄÜͨ¹ýDECLAREÉùÃ÷¶øVB²»ÐУ¿
2¡¢Èç¹ûÕâ¸ödllÖÐµÄ ......
ÏëÖªµÀÿÌõÖ¸Áî»òº¯ÊýµÄϵͳÏûºÄ¡£±ÈÈçϵͳִÐÐint a=0£»µÄ¿ªÏúÊǶàÉÙ¡£ÓÐûÓÐÀàËÆµÄÎĵµÖ®ÀàµÄ¡£²»ÒªºÍÎÒ˵ÓÃʲôclock()º¯ÊýÀ´²âÊÔ¡£ÎÒÏëÒªÏà¹Ø×ܽáºÃµÄÎĵµ
ÏÈ·´»ã±à,È»ºóÄÃ×ÅcpuµÄÖ¸ÁîÊÖ²á²éÿÌõÖ¸ÁîµÄʱ¼äÖÜÆÚ ......
¹¤×÷ÄÚÈÝ Ñз¢
×ʸñÒªÇó£º
211ºÍÖØµãԺУ±¾¿Æ 3Ä깤×÷¾Ñé
211ºÍÖØµãԺУ˶ʿ 1Ä깤×÷¾Ñé
ÆÕͨԺУÔÚ¹¤×÷ÄêÏÞÉϸ÷¼Ó1Äê
ÓÐͨÐÅÏà¹Ø¿ª·¢¾ÑéÕßÓÅÏÈ£¬µ±È»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", ......