这是一道百度的笔试题

问:关于下面的程序输出为:

  • A:1
  • B:2
  • C:3
  • D:编译无法通过

A Baidu Written Test Question

Q: What does the following program output?

  • A: 1
  • B: 2
  • C: 3
  • D: It won’t compile
1
2
3
4
5
6
7
8
9
10
11
12
#include <iostream>
using namespace std;

void test(int a,int b,int c){
int *p = &b;
cout << *(p-1) << endl;
}

int main(){
test(1,2,3);
return 0;
}

正确答案是…

The correct answer is…

C/C++Wiki笔试

C++ 中的 new

C++ 中使用 new 关键字来创建一个对象,创建对象的过程会产生以下操作:

  1. 在内存中申请一块空间,大小为目标对象的大小,并获得该内存空间的地址。
  2. 将该内存空间的地址转换为对象指针。
  3. 通过对象指针调用该对象的构造函数。

new in C++

In C++, the new keyword is used to create an object, and the object creation process involves the following operations:

  1. Allocate a block of memory, sized to the target object, and obtain the address of that memory.
  2. Convert the address of that memory into an object pointer.
  3. Invoke the object’s constructor through the object pointer.
C/C++WikiSTL

为了给我的资源分享站GitHub主页增加一个花里胡哨的Readme,利用 GitHub 上提供的下载 Pixiv 日榜的代码每天定时下载 P 站的日榜,并选择前三张放在 Readme 里。日榜每天都更新,图片每天都要下载,我又是一个喜欢屯东西的人,那么就面临了一个下载下来的图片保存到哪里的问题。一开始想的自然是存到阿里云盘,但是国内提供的服务就是没有隐私可言,存在别人那里的东西都会被人看光光,至少是被阿里云的鉴黄算法看光光😂,于是就出现了下面这种情况。

image-20220209003041597

直接把我图片给删除了!👍

To add a fancy Readme to my resource-sharing site and my GitHub homepage, I used the code GitHub provides for downloading the Pixiv daily ranking to automatically download the daily ranking every day, then put the top three images in the Readme. The daily ranking updates every day, so the images need to be downloaded every day — and since I’m the kind of person who likes to hoard things, I was faced with the question of where to store the downloaded images. At first I naturally thought of Alibaba Cloud Drive, but domestic services simply have no privacy — anything stored on someone else’s server gets seen by everyone, at least by Alibaba Cloud’s porn-detection algorithm 😂, and that’s how the situation below came about.

image-20220209003041597

It straight-up deleted my images! 👍

Wiki教程PythonGitHub

免流是什么

免流就是免流量费的意思,实现免流量费的核心思路就是利用代理软件把手机的流量伪装成运营商不收费的流量进行上网。什么样的流量是运营商不收费的流量呢?一种是所谓的定向流量,比如我使用的电信星卡,对百度系、头条系、爱奇艺等应用的流量是免费的。另一种是绿色通道流量,绿色通道是指手机停机时也可以访问的网站,之所以让你能在停机的状态下访问这个网站,是为了让你方便为手机充值的,但不是所有的地区都有绿色通道的,并且现在对绿色通道的网速也有限制。

于是,相对应的免流方式有两种,一种是伪装定向流量免流,另一种是停机卡免流,本文介绍一种基于xray面板搭建免流节点的方式,供读者参考。

What Is Free Data

Free data means being exempt from data charges. The core idea behind it is to use a proxy tool to disguise your phone’s traffic as traffic that the carrier does not charge for. What kind of traffic does the carrier not charge for? One kind is the so-called directional traffic - for example, the China Telecom Star Card I use gives free data for apps in the Baidu family, Toutiao family, iQiyi, and so on. The other kind is green channel traffic: the green channel refers to websites that can still be accessed when your phone is suspended. The reason these sites are accessible while suspended is so that you can conveniently top up your phone, but not every region has a green channel, and the green channel’s bandwidth is also limited these days.

Correspondingly, there are two ways to get free data: one is disguising directional traffic, and the other is suspended-card free data. This article introduces a way to set up a free-data node based on the xray panel for your reference.

教程分享VPS免流

最近在看这个,由于原项目网页域名不太好记,就转载重新记录一下。

这里主要记录一些基础内容。

I’ve been reading this recently. Since the domain of the original project’s website is not easy to remember, I’m reposting and re-recording it here.

This mainly records some basic content.

C/C++Wiki