求助(编译能通过连接不能通过)
错误求助帖(急)
我把打印两种九九乘法表的程序分别放在了两个文件下,调试时出现错误:编译时可以通过,连接时不行
void table1();// head.h
void table2();
#include"head_.h"//主函数
void main()
{
table1();
table2();
}
#include<iostream.h>// table1.cpp
# include"head_.h"
void table1()
{
int i,j,k;
cout<<" "<<"*"<<" ";
for(i=1;i<=9;i++)
cout<<i<<" ";
cout<<endl;
for(j=1;j<=9;j++)
{
cout<<" "<<j<<" ";
for(k=1;k<=j;k++)
cout<<j*k<<" ";
cout<<endl;
}
}
#include<iostream.h>// table2.cpp
# include"head_.h"
void table2()
{
int i,j,k,m;
cout<<" "<<"*"<<" ";
for(i=1;i<=9;i++)
cout<<i<<" "<<endl;
for(j=1;j<=9;j++)
{
cout<<j;
for(m=1;m<=j;m++)
cout<<" ";
for(k=9;k>=j;k--)
cout<<j*k<<" ";
cout<<endl;
}
}