小编use*_*152的帖子

Makefile警告:警告:文件`main.cpp'将来有修改时间2.1e + 04 s

我有工作Makefile,但有一个警告,我无法解决.

#Use the g++ compiler
CC = g++

# Compiler flags:
#   -Wall (most warnings enabled)
#   -g (for debugging with gdb)
CFLAGS = -Wall

# Executable name:
TARGET = deque_adt

all: main.o deque_adt.o deque_adt

$(TARGET): main.o deque_adt.o
    $(CC) $(CFLAGS) main.o deque_adt.o -o $(TARGET)

main.o: main.cpp deque_adt.h 
    $(CC) $(CFLAGS) main.cpp -c

deque_adt.o: deque_adt.cpp deque_adt.h
    $(CC)  $(CFLAGS) deque_adt.cpp -c

clean:
    rm *.o *~ $(TARGET)
Run Code Online (Sandbox Code Playgroud)

错误:

make: Warning: File `main.cpp' has modification time 2.1e+04 s in the future
g++ -Wall …
Run Code Online (Sandbox Code Playgroud)

linux makefile

14
推荐指数
3
解决办法
5万
查看次数

如何为递归函数编写方法定义?

我有一个家庭作业问题说:

Destructor_Helper是一个递归函数,可以解除分配单链表的每个节点.编写destructor_helper的方法定义.

 struct Node
 {
      string data;
      Node *next;
 }

 void List::~List()  {
     destructor_helper(head);
 }
Run Code Online (Sandbox Code Playgroud)

我的回答是:

     void Destructor_Helper(Node *n) {
     cout<< n->data << endl;
     if (n->next != NULL)
          Destructor_Helper(n->next);
 } 
Run Code Online (Sandbox Code Playgroud)

我的回答被认为是错误的,有人会帮我解决问题.

c++ recursion data-structures

2
推荐指数
1
解决办法
81
查看次数

标签 统计

c++ ×1

data-structures ×1

linux ×1

makefile ×1

recursion ×1