#include<stdio.h>

void main()
{
puts("hello world");
int x=4;
//the %p format will print out the location in hex(base lb) format
printf("x lives at %p\n",&x);
int * addr_of_x = &x;
printf("x lives at %p\n",addr_of_x);
printf("the content of addr_of_x is %d\n",*addr_of_x); printf("the size of int is %d\n",sizeof(int));
char quote[]="turtles!";
// this will return 9, which is 8 characters plus the \0 end character
printf("the size of int is %d\n",sizeof(quote));
//why pointers have types?
/**
different data types has different size, when you do pointer arithmetic,
the compiler will not know how to increce the value when you not specify
the concrete data type of the pointer.
**/
int doses[] = {1, 3, 2, 1000};
printf("Issue dose %i\n", 3[doses]);
/*
char name[40];
printf("Enter your name: ");
scanf("%39s",name);
printf("your name is :%s\n",name);
int age;
printf("Enter your age: ");
scanf("%i\n", &age);
printf("your age is :%i\n",age);
//be careful with this , if your input is bigger than your variable to hold it.
//it will cause buffer overflows
char food[5];
printf("Enter favorite food: ");
fgets(food, sizeof(food), stdin);
printf("your favorite food is :%s\n",food);
*/
char *cards="JQK";
//string literals can never be updated
//the following code will cause one error,
//but it will pass compile
//why cause this? the string literals will store one read only memory.
//these constants will be used all threads, so can not changed.
//cards[1]='K';
puts(cards);
printf("address of the cards is :%p\n",cards);
printf("address of the string JQK is :%p\n",&"JQK");
char cards2[]="JQK";
puts(cards2);
printf("address of the cards is :%p\n",cards2); }
refer: head first C

Learning c section 1的更多相关文章

  1. (转) Ensemble Methods for Deep Learning Neural Networks to Reduce Variance and Improve Performance

    Ensemble Methods for Deep Learning Neural Networks to Reduce Variance and Improve Performance 2018-1 ...

  2. (转)Understanding, generalisation, and transfer learning in deep neural networks

    Understanding, generalisation, and transfer learning in deep neural networks FEBRUARY 27, 2017   Thi ...

  3. opencv7-ml之svm

    因为<opencv_tutorial>这部分只有两个例子,就先暂时介绍两个例子好了,在refman中ml板块有:统计模型.普通的贝叶斯分类器.KNN.SVM.决策树.boosting.随机 ...

  4. Support Vector Machines for classification

    Support Vector Machines for classification To whet your appetite for support vector machines, here’s ...

  5. OpenCV支持向量机(SVM)介绍

    支持向量机(SVM)介绍 目标 本文档尝试解答如下问题: 如何使用OpenCV函数 CvSVM::train 训练一个SVM分类器, 以及用 CvSVM::predict 测试训练结果. 什么是支持向 ...

  6. [DOM Event Learning] Section 4 事件分发和DOM事件流

    [DOM Event Learning] Section 4 事件分发和DOM事件流 事件分发机制: event dispatch mechanism. 事件流(event flow)描述了事件对象在 ...

  7. [DOM Event Learning] Section 3 jQuery事件处理基础 on(), off()和one()方法使用

    [DOM Event Learning] Section 3 jQuery事件处理基础 on(),off()和one()方法使用   jQuery提供了简单的方法来向选择器(对应页面上的元素)绑定事件 ...

  8. [DOM Event Learning] Section 2 概念梳理 什么是事件 DOM Event

    [DOM Event Learning] Section 2 概念梳理 什么是事件 DOM Event   事件 事件(Event)是用来通知代码,一些有趣的事情发生了. 每一个Event都会被一个E ...

  9. [DOM Event Learning] Section 1 DOM Event 处理器绑定的几种方法

    [DOM Event Learning] Section 1 DOM Event处理器绑定的几种方法   网页中经常需要处理各种事件,通常的做法是绑定listener对事件进行监听,当事件发生后进行一 ...

随机推荐

  1. csharp: get Web.Services WebMethod

    using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.We ...

  2. 并发式IO的解决方案:多路非阻塞式IO、多路复用、异步IO

    在Linux应用编程中的并发式IO的三种解决方案是: (1) 多路非阻塞式IO (2) 多路复用 (3) 异步IO 以下代码将以操作鼠标和键盘为实例来演示. 1. 多路非阻塞式IO 多路非阻塞式IO访 ...

  3. [moka收藏]php正则表达式验证

    手机号验证规则[['mobile'], 'match','pattern' =>"/^1[34578]\\d{9}$/"], [['sendmail_limit'],'mat ...

  4. 成熟的RosettaNet解决方案软件介绍

    RosettaNet是一套B2B标准,以标准来优化供应链管理流程,它可以缩短整个供应链各个供货周期.RosettaNet 标准为电子商务标准化提供一个健壮的.非专有的解决方案,它是免费的,通过 Ros ...

  5. Maven的安装使用以及 Maven+Spring hello world example

    关于Maven Maven是一个用于项目构建的工具,通过它便捷的管理项目的生命周期.即项目的jar包依赖,开发,测试,发布打包. 做过.NET的人应该会联想到Nuget,是的Maven其实就是java ...

  6. [Intellij] 编译报错 javacTask

    报错信息: Idea 编译报错 javacTask: 源发行版 1.6 需要目标发行版 1.6 解决方案:

  7. swift学习笔记之-构造过程

    //构造过程 import UIKit /* 构造过程(Initialization): 1.构造过程是使用类.结构体或枚举类型的一个实例的准备过程.在新实例可用前必须执行这个过程,具体操作包括设置实 ...

  8. C#中的Mutex对象认识

    我们知道,有些应用程序可以重复打开,有些只能打开一个,我以前写的程序为了防止用户打开多个程序,都是去遍历Process 查找进程的方式,现在看起来真是不专业,今天看大神的破解分析文章时,认识了mute ...

  9. [C/C++] VS 2015 C++ 插件

    Visual Studio2015 Community一些必备插件 ReSharper C++ 各种语言版本的代码重构,代码风格,代码修正功能,非常强大,可惜不是免费的,不过好在可以破解呢. Vias ...

  10. 数组拷贝 copyOf()

    Arrarys类的copyof方法与copyOfRange方法可以实现对数组的复制,前者是复制数组到指定的长度,后者将指定的长度复制到一个新数组中. 1.copyOf()方法 该方法提供了很多种重载形 ...