
Jim Hall
Articles
-
2 months ago |
lbc.co.uk | Jim Hall
I work on Britain's biggest building projects - the real growth blocker is cost not capability 29 January 2025, 07:46 | Updated: 29 January 2025, 07:50 I work on Britain's biggest building projects - the real growth blocker is cost not capability. Picture: Alamy By Jim Hall As a civil engineer, I’m always saddened to be asked why the UK doesn’t build anymore, or whether it should accept that it is no longer a place for large infrastructure projects.
-
Jul 18, 2023 |
linux.cn | Jim Hall
在 C 语言中读取字符串是一件非常危险的事情。当读取用户输入时,程序员可能会尝试使用 C 标准库中的 gets 函数。它的用法非常简单: char *gets(char *string); gets() 从标准输入读取数据,然后将结果存储在一个字符串变量中。它会返回一个指向字符串的指针,如果没有读取到内容,返回 NULL 值。 举一个简单的例子,我们可能会问用户一个问题,然后将结果读入字符串中: #include <stdio.h> #include <string.h> int main() { char city[10]; // 例如 "Chicago" // 这种方法很糟糕 .. 不要使用 gets puts("Where do you live?"); gets(city); printf("<%s> is length %ld\n", city, strlen(city)); return 0; } 输入一个相对较短的值就可以: Where do you live?
-
May 23, 2023 |
linux.cn | Jim Hall
Go 是一种现代编程语言,它很大程度上源自于 C 编程语言。因此,对于写 C 程序的程序员来说,Go 应该会感觉很熟悉。Go 让编写新程序变得容易,同时让 C 程序员感觉熟悉,但避免了 C 编程语言的许多常见陷阱。 本文比较了一个简单的 C 和 Go 程序,该程序将数字从一相加到十。由于这个程序只使用了小的数值,所以结果不会变得太大,因此只使用了普通的整数变量。像这样的循环在编程中非常常见,所以这个简单的程序很容易比较 C 和 Go。 C 语言中最基本的循环是 for 循环,它允许你对一组值进行迭代。for 循环的基本语法是: for (起始条件 ; 结束条件 ; 每次迭代后执行的操作) { 循环内要执行的内容 ; } 你可以编写一个 for 循环,以打印从 1 到 10 的数字,将起始条件设置为 count = 1,将结束条件设置为 count <= 10。这样就以 count 变量等于 1 时开始循环。结束条件意味着只要 count 变量小于或等于 10 ,循环就会继续。 每次迭代之后,你使用 count = count + 1 将 count 变量的值增加...
-
Apr 25, 2023 |
opensource.com | Jim Hall
I use GNOME as my primary desktop environment on my Linux PC at home. GNOME gives me an easy-to-use graphical desktop that provides the flexibility I need yet doesn't get in my way when I focus on my work. GNOME recently released GNOME 44 with a bunch of new features. I reached out to the GNOME team to ask about the latest version and what was in it.
-
Apr 24, 2023 |
opensource.com | Jim Hall
Go is a modern programming language that derives much of its history from the C programming language. As such, Go is likely to feel familiar to anyone who writes programs in C. Go makes it easy to write new programs while feeling familiar to C programmers but avoiding many of the common pitfalls of the C programming language. This article compares a simple C and Go program that adds the numbers from one to ten.
Try JournoFinder For Free
Search and contact over 1M+ journalist profiles, browse 100M+ articles, and unlock powerful PR tools.
Start Your 7-Day Free Trial →