如何用c++编程来同时建40个文件夹

来源:百度知道 编辑:UC知道 时间:2024/05/29 00:30:33
在线等
如果答对了,有赏
热那亚水手的答案,我试了试怎么不行。你能在桌面上同时建20个文件夹吗,用c++?

#include <direct.h>
#include <stdlib.h>
#include <stdio.h>

void main( void )
{
char dir[40][10];
for(int i=0;i<40;i++)
{
sprintf(dir[i],"dir%d",i);
if( _mkdir( dir[i] ) == 0 )
{
printf( "Directory '\\testtmp' was successfully created\n" );
system( "dir \\testtmp" );
}
}
}

我也想知道