C/C++
文章平均质量分 58
myflyinsky
速度与激情
展开
-
派生类构造函数中调用基类虚函数,能够发生多态?-(否)
#include<iostream>using namespace std;class A{public: A(int a) :a(a) { cout << "constructor A :" << a << endl; test1(); test2(); } ...原创 2018-02-27 11:38:00 · 1103 阅读 · 0 评论 -
Linux C通过socket获取网络设备ip地址的方法
#include <stdio.h>#include <string.h>#include <sys/socket.h>#include <arpa/inet.h>#include <net/if.h>int get_ip(const char *ifname, char *ip){ int sock_get_ip;...原创 2018-04-16 16:14:50 · 4959 阅读 · 5 评论 -
通用Makefile文件的编写
BIN := ./binSRC := ./srcINC := ./includeOBJ := ./objsALL_SOURCES := $(wildcard $(SRC/*.c)ALL_OBJECTS := $(patsubst %.c,%.o,$(notdir $(ALL_SOURCES)))OBJECTS := $(foreach file,$(ALL_OBJECTS)...原创 2018-04-16 16:22:05 · 226 阅读 · 0 评论