哈佛大学CS50课程笔记--函数,全局变量,参数,返回值

类型转换typecasting,Because of a different flight path,a data conversion from a 64 bit floating point value to a 16 bit signed integer value caused a hardware exception.More specifically an arithmetic overflow as the floating point number had a value too large to be represented by a 16 bit signed integer.

ASCIImation

API,application programming interfaces

The homework,introduced to the candy machine that is free in the lounge in Maxwell Dworkin which you are welcome to start frequenting.We'll  occasionally hold some office hours there and hang out ,but the challenge here is really just to get your hands dirty with Linux and with C.and what you'll find in,even though the problem is relatively simple in concept,we challenge you to implement a program that allows you,the human,to guess how many skittle are in candy machine.you simulate this candy machine using some pseudo-random numbers.And we walk of generating pseudo-random numbers in a computers memory and then ultimately you ,the human,gets to interact with your own program.

Greedy,what's nice is when greedy algorithms which are generally easy conceptually and to implement and to execute what's really niceat is when is also optimal.

We can simulate this using ASCII art.Using characters on the keyboard to give a decent approximation of what a bar graph is and so here will you be asked .

Well what about this issue of imprecision?So that was kind of a lie,so when we've said before that computers only have a finite amount of memory on this a finite amount of precision which is another way of saying if you've only got a fixed number of bits,surely you cannot represent with a fixed number of bits,it's number of real or rational numbers that exist in the world.

Unfortunately the compiler only knows to execute one line of code after a for loop unless you have ebcapsulated it

 

Typecasting is just this processs of taking one data type like an int and casting it.

When I am  using double quotes as an argument as an input to Printf so that is a string,what we're been calling it.

So if you don't specify a return value at least in main,the value of zero is just assumed so you don't have .zero means nothing went wrong,I'm not going to tell youtyhat nothing went wrong but unfortunitely with programming but with computers can we make a heck of a lot of mistakes.

 

猜你喜欢

转载自blog.csdn.net/weixin_43218659/article/details/87973719