#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. Python入门笔记(11):集合

    一.目录 1.集合概述 2.关于集合的操作符.关系符号 3.集合的一系列操作(添加.更新.访问.删除) 4.关于集合的内建函数.内建方法 5.小结 二.集合概述 集合(set):把不同的元素组成一起形 ...

  2. Python基础:元类

    一.概述 二.经典阐述 三.核心总结 1.类的创建过程 2.元类的使用惯例 四.简单案例 1.默认行为 2.使用元类 五.实践为王 一.概述 Python虽然是多范式的编程语言,但它的数据模型却是 纯 ...

  3. 【jQuery基础学习】06 jQuery表单验证插件-Validation

    jQuery的基础部分前面都讲完了,那么就看插件了. 关于jQuery表单验证插件-Validation validation特点: 内置验证规则:拥有必填.数字.E-Mail.URL和信用卡号码等1 ...

  4. csharp: WebBrowser read baidumap

    setpoint.html: <!DOCTYPE html> <html> <head> <meta http-equiv="Content-Typ ...

  5. sql添加合计

    在项目中发现有这样的写法 SELECT ZoneID,CountSQAZFZSBJZ3G+CountSQGZJRJZSL3G AS column1FROM G3MulticarrierSiteCove ...

  6. 布局文件预览:Rendering Problems Exception raised during rendering: Unable to find the layout for Action Bar.的解决

    在android studio或者eclipse中打开layout文件,发现不能预览布局,提示以下错误: Rendering Problems Exception raised during rend ...

  7. SVG描边动画原理

    SVG描边动画原理其实很简单,主要利用以下两个属性 stroke-dasharray 制作虚线,使得黑白相间, stroke-dashoffset 使得虚线向开头偏移,这里的1500不精确,是我随便取 ...

  8. 代码导出Reporting Services报表文件

    背景部分 使用Reporting Services很容易制作和发布我们需要的报表,报表效果也还不错 不过如果报表数据过大或报表数量过多,打开及查看报表感觉可能就是另外一回事了 好在Reporting ...

  9. 3.0之后在LinearLayout里增加分割线

    android:divider="@drawable/shape"<!--分割线图片--> android:showDividers="middle|begi ...

  10. 第一个JSP程序

    本文介绍如何写出第一个JSP程序 1.配置服务器 (1)在eclipse中选择Server视图,(ps:很多童鞋说找不到Server,那是因为eclipse的版本问题,请下载JEE版本的eclipse ...