Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/c/56.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C 如何消除这些当前错误?_C_Pointers_Routing_Ip - Fatal编程技术网

C 如何消除这些当前错误?

C 如何消除这些当前错误?,c,pointers,routing,ip,C,Pointers,Routing,Ip,到目前为止,这是我的程序,不幸的是我遇到了一些错误,我不知道如何解决它们。我不太擅长编程,所以如果有人能帮我,那就太好了 #include <stdio.h> #include "stdlib.h" #include "string.h" void Ouccpy_Routing_Table(); typedef struct RTE { unsigned long Dest; int port; int netport; }; Route[120];

到目前为止,这是我的程序,不幸的是我遇到了一些错误,我不知道如何解决它们。我不太擅长编程,所以如果有人能帮我,那就太好了

#include <stdio.h>
#include "stdlib.h"
#include "string.h"


void Ouccpy_Routing_Table();

typedef struct RTE
{
    unsigned long Dest;
    int port;
    int netport;
};

Route[120];

struct IP
{
unsigned char Ipverison;
unsigned char TOS;
short ID;
short Fragoffset;
unsigned char TTL;
unsigned char Protcl;
short dcheksum;
unsigned char Data[1];

}; RTE;

int main()
{
int count;


FILE *ptr_testfile;

struct IP my_testfile;

ptr_testfile = fopen("C:\\ROUTE\\TEST ROUTE.txt", "rb");

if (!ptr_testfile)
{
    printf("Cannot Open File!");

    return 0;
}

}

void Ouccpy_Routing_Table(int IPAddress, int IP_Dest, int route)
{
IPAddress = IP_Dest;

if (CLASS_A(IPAddress)) Mask:(0xff0000000);
if (CLASS_B(IPAddress))(0xffff00000);

route[0].netDest = 0;
route[0].port = 1;

route[1].netDest = 0;
route[1].port = 2;

route[3].netDest = 0;
route[3].port = 3;

}
#包括
#包括“stdlib.h”
#包括“string.h”
void Ouccpy_Routing_Table();
类型定义结构RTE
{
无符号长Dest;
国际港口;
国际网络端口;
};
路线[120];
结构IP
{
无符号字符;
无符号字符;
短ID;
短框架;
无符号字符TTL;
无符号字符Protcl;
短dcheksum;
无符号字符数据[1];
}; RTE;
int main()
{
整数计数;
文件*ptr_测试文件;
结构IP我的测试文件;
ptr_testfile=fopen(“C:\\ROUTE\\testroute.txt”、“rb”);
如果(!ptr_testfile)
{
printf(“无法打开文件!”);
返回0;
}
}
无效Ouccpy_路由_表(int IPAddress、int IP_Dest、int route)
{
IP地址=IP地址;
if(CLASS_A(IPAddress))掩码:(0xff0000000);
if(B类(IP地址))(0xffff00000);
路由[0]。netDest=0;
路由[0]。端口=1;
路由[1]。netDest=0;
路由[1]。端口=2;
路由[3]。netDest=0;
路由[3]。端口=3;
}
15 IntelliSense:表达式必须具有指向对象类型c:\Users\lildj\u 000\Documents\Visual Studio 2013\Projects\Lab 2 Routing Table\Lab 2 Routing Table\Main.c 64 8 Lab 2 Routing Table的指针

错误7错误LNK2019:未解析的外部符号\u类\u A在函数\u Ouccpy\u路由\u表C:\Users\lildj\u 000\Documents\Visual Studio 2013\Projects\Lab 2路由表\Lab 2路由表\Main.obj Lab 2路由表中引用

错误8错误LNK2019:未解析的外部符号\u类\u B在函数\u Ouccpy\u路由\u表C:\Users\lildj\u 000\Documents\Visual Studio 2013\Projects\Lab 2路由表\Lab 2路由表\Main.obj Lab 2路由表中引用


错误9错误LNK1120:2个未解析的外部C:\Users\lildj_000\Documents\Visual Studio 2013\Projects\Lab 2 Routing Table\Debug\Lab 2 Routing Table.exe 1 1 Lab 2 Routing Table

错误消息的意思是他们所说的。他们告诉你它不知道A类和B类是什么。
CLASS_A
CLASS_B
在哪里定义?它们没有在任何地方定义@潜伏者,如果你能告诉我正确的方向,它们应该在哪里?你一定缺少一个头文件,或者你需要自己定义它们。您的
#include“stdlib.h”
#include“string.h”
如果是标准头,则可能应该是
#include
#include
。(但是他们不会定义
CLASS_A
CLASS_B
)你的实验室是否有一个头文件?你的
if(CLASS_A(…)…)…
if(CLASS_B(…)…
语法都是错误的。那些话没有任何意义。你打对了吗?@DarJude我们不能告诉你。它们可能在作为实验室一部分提供的某个头文件中定义为宏。或者您需要定义它。我们真的不知道,因为我们没有实验室的问题和背景。我们希望自己@kaylum提出头文件。