谁“发明"了i,j,k作为整数计数器变量名称? [英] Who "invented" i,j,k as integer counter variable names?

查看:236
本文介绍了谁“发明"了i,j,k作为整数计数器变量名称?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

可能重复:
为什么我们将i用作循环计数器

Possible Duplicate:
Why are we using i as a counter in loops

我自己使用这些习惯已经超过15年了,但我真的不记得我是如何/在哪里养成这种习惯的.由于它确实很普遍,我很好奇,谁最初建议/推荐使用这些名称作为整数循环计数器(这是K& R书吗?).

I've used these myself for more than 15 years but cannot really remember how/where I picked up that habit. As it is really widespread, I'm curious to know who originally suggested / recommended using these names for integer loop counters (was it the K&R book?).

推荐答案

i =整数

i = integer

来自Fortran,其中整数变量必须以字母I到N开头,而实数变量必须以其他字母开头.因此,我是第一个也是最短的整数变量名称. Fortran是最早被广泛使用的编程语言之一,并且程序员使用它的习惯也被移植到其他语言中.

Comes from Fortran where integer variables had to start with the letters I through N and real variables started with the other letters. Thus I was the first and shortest integer variable name. Fortran was one of the earliest programming languages in widespread use and the habits developed by programmers using it carried over to other languages.

(来自:我们为什么使用我作为循环计数器)

很明显,jk只是您喜欢的字母中的下一个.

Obviously, j and k are just the next ones in your favorite alphabet.

这篇关于谁“发明"了i,j,k作为整数计数器变量名称?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆