writestring203.cpp
来自「Data Abstraction & Problem Solving with 」· C++ 代码 · 共 27 行
CPP
27 行
#include <iostream>using namespace std;struct Node{ char item; Node *next;}; // end structNode *stringPtr;void writeString(Node *stringPtr)// ---------------------------------------------------------// Writes a string.// Precondition: The string is represented as a linked list// to which the pointer stringPtr points.// Postcondition: The string is displayed. The linked list// and stringPtr are unchanged.// ---------------------------------------------------------{ if (stringPtr != NULL) { // write the first character cout << stringPtr->item; // write the string minus its first character writeString(stringPtr->next); } // end if} // end writeString
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?