惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

Simon Willison's Weblog
Simon Willison's Weblog
P
Privacy International News Feed
www.infosecurity-magazine.com
www.infosecurity-magazine.com
T
Troy Hunt's Blog
Hacker News - Newest:
Hacker News - Newest: "LLM"
Attack and Defense Labs
Attack and Defense Labs
S
Secure Thoughts
V2EX - 技术
V2EX - 技术
cs.AI updates on arXiv.org
cs.AI updates on arXiv.org
O
OpenAI News
Cloudbric
Cloudbric
Google Online Security Blog
Google Online Security Blog
Schneier on Security
Schneier on Security
cs.CV updates on arXiv.org
cs.CV updates on arXiv.org
Help Net Security
Help Net Security
Cyberwarzone
Cyberwarzone
G
GRAHAM CLULEY
L
Lohrmann on Cybersecurity
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
Spread Privacy
Spread Privacy
NISL@THU
NISL@THU
N
News and Events Feed by Topic
T
Tenable Blog
S
Security @ Cisco Blogs
N
News and Events Feed by Topic
The Hacker News
The Hacker News
C
CXSECURITY Database RSS Feed - CXSecurity.com
宝玉的分享
宝玉的分享
月光博客
月光博客
酷 壳 – CoolShell
酷 壳 – CoolShell
美团技术团队
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
Google DeepMind News
Google DeepMind News
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
T
Tailwind CSS Blog
V
Visual Studio Blog
P
Proofpoint News Feed
Webroot Blog
Webroot Blog
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
博客园 - 三生石上(FineUI控件)
cs.CL updates on arXiv.org
cs.CL updates on arXiv.org
Jina AI
Jina AI
雷峰网
雷峰网
T
The Blog of Author Tim Ferriss
Hugging Face - Blog
Hugging Face - Blog
腾讯CDC
L
LangChain Blog
The Register - Security
The Register - Security
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
博客园 - 聂微东

博客园 - 阿武

Moto G 通话没声音 Android 手机技巧 一个Java程序的生死旅程 精妙语录 【Windows Phone 7】【软件发布】深圳通助手 & 深圳长途汽车查询 & 深圳地铁通 【Ruby】删除旧文件 京东自动抢购机 64位的处理器支持多大的内存? 将.NET Entity Framework 的 Cache模块移植到JAVA平台 做快乐的程序员 Q 语言初学者系列:(3)Lists 初级 KDB+性能分析:内存篇 Q 语言初学者系列:(2)基本数据类型 Q 语言初学者系列:(1)开门篇 熟悉的感觉 盘点自己两年来走过的路 [JAVA]你见过这样的switch吗? - 阿武 - 博客园 网站上图片"另存为" 为什么是 bmp 格式 经实验, 网线两端都接在交换机上并不会烧毁交换机
[C++ Primer] Passing an array to a function by reference/pointers -- sample
阿武 · 2011-06-28 · via 博客园 - 阿武

#include <cstdlib>
#include 
<iostream>using namespace std;// Takes a pointer to the array, and the size of the array.
void print_arr1(const int *arr, size_t size)
{
    
for (size_t ix = 0; ix != size; ++ix) {
        cout 
<< arr[ix] << ' ';
    }
    cout 
<< endl;
}
// Takes 2 pointers. One to the beginning of the array, 
// and one to 1 past the last element - just like iterating through a vector.
void print_arr2(const int *beg, const int *end)
{
    
for (/* empty */; beg != end; ++beg) {
        cout 
<< *beg << ' ';
    }
    
    cout 
<< endl;
}
// Takes an array of size 10 and uses it as a const reference.
void print_arr3(const int (&arr)[10])
{
    size_t size 
= 10;
    
for (size_t ix = 0; ix != size; ++ix) {
        cout 
<< arr[ix] << ' ';
    }
    cout 
<< endl;
}
int main() 
{
    
int arr[] = {0123456789};
    
int *parr = arr;
        
    print_arr1(parr, 
10);
    print_arr2(parr, parr
+10);
    print_arr3(arr);    
    
    
return EXIT_SUCCESS;
}