如何将值从一个函数发送到另一个函数?
我有这个例子:
/* Include files */
#include <iostream>
#include <string>
#include <limits>
#include <sqlca.h>
#include <sqlcpr.h>
#include <iomanip>
#include <conio.h> // ntuk password masking
/* Declaration of functions and constants used */
#include "Functions.h"
using namespace std;
void fnMainMenu();
void fnLogin()
{
char data[6] = "hello";
fnMainMenu(); // call Main Menu and I want to pass "hello"
}
void fnMainMenu()
{
cout << "I want to display hello here?";
}
int main()
{
fnLogin();
return 0;
}
我该怎么做呢?我从网上找到的教程解释了在 main 上显示数据。提前致谢。