What is the computer program?

原创 2006年05月28日 20:25:00
  • A computer program, also called software, is a way to tell a computer what to do.
  • FunctionMost languages allow you to create functions of some sort. Functions let you chop up a long program into named sections so that the sections can be reused throughout the program. Functions accept parameters and return a result.

 
  • Every library consists of two parts: a header file and the actual code file. The header file, normally denoted by a .h suffix, contains information about the library that programs using it need to know. In general, the header file contains constants and types, along with prototypes for functions available in the library.
  • printf - prints formatted output to stdout
  • scanf - reads formatted input from stdin
  • puts - prints a string to stdout
  • gets - reads a string from stdin
  • putc - prints a character to stdout
  • getc, getchar - reads a character from stdin
  • fopen - opens a text file
  • fclose - closes a text file
  • feof - detects end-of-file marker in a file
  • fprintf - prints formatted output to a file
  • fscanf - reads formatted input from a file
  • fputs - prints a string to a file
  • fgets - reads a string from a file
  • fputc - prints a character to a file
  • fgetc - reads a character from a file



C uses pointers in three different ways:

  • C uses pointers to create dynamic data structures -- data structures built up from blocks of memory allocated from the heap at run-time.

  • C uses pointers to handle variable parameters passed to functions.

  • Pointers in C provide an alternative way to access information stored in arrays. Pointer techniques are especially valuable when you work with strings. There is an intimate link between arrays and pointers in C.

The text editor is a programmer's intimate link to the computer


A process may start many threads or other processes, but a thread cannot start a process.


You can think of the word static as meaning "no matter how many objects are made, there will be only one of these."

Network

The following is an example of a URL which addresses the Java Web site hosted by Sun Microsystems:

As in the previous diagram, a URL has two main components:
  • Protocol identifier
  • Resource name

The resource name contains one or more of the components listed in the following table:

Host Name The name of the machine on which the resource lives.
Filename The pathname to the file on the machine.
Port Number The port number to which to connect (typically optional).
Reference A reference to a named anchor within a resource that usually identifies a specific location within a file (typically optional).
import java.net.*;
import java.io.*;

public class ParseURL {
public static void main(String[] args) throws Exception {
URL aURL = new URL("http://java.sun.com:80/docs/books/"
+ "tutorial/index.html#DOWNLOADING");
System.out.println("protocol = " + aURL.getProtocol());
System.out.println("host = " + aURL.getHost());
System.out.println("filename = " + aURL.getFile());
System.out.println("port = " + aURL.getPort());
System.out.println("ref = " + aURL.getRef());
}
}
Here's the output displayed by the program:
protocol = http
host = java.sun.com
filename = /docs/books/tutorial/index.html
port = 80
ref = DOWNLOADING

What Is a Compact Framework Program

  • 2011年11月09日 14:22
  • 262KB
  • 下载

What is Computer Science

  • 2014年10月15日 08:05
  • 4.09MB
  • 下载

bkb is a program to control keyboard/mouse with eyes(2)

To be honest, initially I wanted to make buttons blow like bubbles when you stare on them. This wo...

What Is Computer Science

  • 2017年08月22日 23:18
  • 6.17MB
  • 下载

_What is Cone-Beam CT

  • 2016年02月23日 21:12
  • 2.03MB
  • 下载

Perhaps JAVA_HOME does not point to the JDK. It is currently set to "C:\Program Files\Java\jre7"

今天在Eclipse下使用Ant构建工程遇到 Perhaps JAVA_HOME does not point to the JDK. It is currently set to "C:\Progr...

what is statistics.

  • 2014年08月06日 16:54
  • 888KB
  • 下载

what is html5

  • 2013年01月08日 10:26
  • 3.46MB
  • 下载

Why is it so hard to make a Java program appear native?

One solution is to rewrite the application for each system.
  • flyonok
  • flyonok
  • 2014年08月12日 14:45
  • 760

Pair Programming What is in it for me.pdf

  • 2011年08月22日 10:35
  • 353KB
  • 下载
内容举报
返回顶部
收藏助手
不良信息举报
您举报文章:What is the computer program?
举报原因:
原因补充:

(最多只允许输入30个字)