小编use*_*467的帖子

如何使用 Express Node.js 打印到 html

如何以 html 形式显示服务器端 Node.js 变量中保存的文本。

换句话说,为了更加清楚,我从访问 twitter (Twitt) 的 api 中提取了输出,并且我试图在页面底部显示该文本。

网页的名称是这样的

app.get('/', function (req, res) {
    res.sendfile('./Homepage.html');
});
Run Code Online (Sandbox Code Playgroud)

这是调用 Node.js 文件的地方:

var express = require('express');
var app = express();
Run Code Online (Sandbox Code Playgroud)

这是变量的位置:

T.get('search/tweets', { q: hash1 + ' since:2013-11-11', count: 5 },
    function(err, reply) {
        response = (reply),
        console.log(response)
        app.append(response)
    })
Run Code Online (Sandbox Code Playgroud)

html javascript node.js express

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

如何在两个不同的函数c ++中访问动态数组

我需要在两个不同的函数中访问动态数组.在一个中进行的更改需要转移到另一个.

这些是功能:

void populate(int size, int *ptr)
{
    ptr = new int[size];
    for (int i = 0; i < size; i++)
    {
        ptr[i] = rand() % 51;
    }
}

void display(int size, int *ptr)
{
    for (int i=0; i < size; i++)
    {
        cout << ptr[i] << endl;
    }
}
Run Code Online (Sandbox Code Playgroud)

它在主要被称为

int* ptr = NULL;
Run Code Online (Sandbox Code Playgroud)

c++ pointers

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

标签 统计

c++ ×1

express ×1

html ×1

javascript ×1

node.js ×1

pointers ×1