C語言筆試題總結

1. 下面這段代碼的輸出是多少(在32位機上).

??? char *p;?? // 4

??? char *q[20];?? // 80

??? char *m[20][20];? // 1600

??? int (*n)[10];?? // 4

??? struct MyStruct

{

char dda;

double dda1;

int type ;

};?
MyStruct k;?? // 24

?printf("%d %d %d %d",sizeof(p),sizeof(q),sizeof(m),sizeof(n),sizeof(k));

2.

(1)

char a[2][2][3]={{{1,6,3},{5,4,15}},{{3,5,33},{23,12,7}} };
for(int i=0;i<12;i++)
printf("%d ",___*(**a+i)____);


在空格處填上合適的語句,順序打印出a中的數字

(2)

char **p, a[16][8];?

問:p=a是否會導致程序在以后出現問題?為什么?

編譯就通不過,p是一個指針的指針,而a是一個2維數組的首地址。
但是*p = a也是錯誤的。

3.用遞歸方式,非遞歸方式寫函數將一個字符串反轉.

?? 函數原型如下:char *reverse(char *str);

#include <stdio.h>

/*=======================================================
函 數 名: reverse()
參??? 數: str
功能描述: 將一個字符串翻轉
返 回 值: const char*
拋出異常: 無
=======================================================*/

const char *reverse(char *str);

int main()
?{
? const char *pch;?????? // 用于取得函數的返回值,來輸出翻轉后的結果
???? char chArray[] = " Hello World ! ";?? // 存儲一個將要翻轉的字符串
? pch = reverse(chArray);???? // 將字符串chArray翻轉
? printf("%s/n",pch);???????? // 打印字符串chArray
? return 0;
?}

const char *reverse(char *str)
?{
? if(str == NULL)
?? return NULL;
? int? nCount = 0;?????????? // 用來統計字符串的大小
? int? nCount_div;?????????? // 將字符串的大小折半
? const char *pRemark_begin;?????? // 標記字符串的首地址
? char chTemp;?????????????? // 用于交換字符串的臨時變量
? char *pString_begin;?????? // 存儲交換的頭指針
? char *pString_end;???????? // 存儲交換的尾指針

? pString_begin = str;
? pRemark_begin = str;

? while(*str != '/0')??????? // 尋找字符串的結尾
? {
?? str++;
?? nCount++;
? }
? pString_end = --str;?????? // 退回一個才是字符串的末尾
? nCount_div = nCount/2;

? while(nCount_div>0)??????? // 將字符串翻轉
? {
?? chTemp = *pString_begin;
?? *pString_begin = *pString_end;
?? *pString_end = chTemp;
?? pString_begin++;
?? pString_end--;
?? nCount_div--;
? }
? return pRemark_begin;
?}

4.strcpy函數和memcpy函數有什么區別?它們各自使用時應該注意什么問題?

5.寫一個函數將一個鏈表逆序.

一個單鏈表,不知道長度,寫一個函數快速找到中間節點的位置.

寫一個函數找出一個單向鏈表的倒數第n個節點的指針.(把能想到的最好算法寫出).

6.用遞歸算法判斷數組a[N]是否為一個遞增數組。

7.

有一個文件(名為a.txt)如下,每行有4項,第一項是他們的名次,
寫一個c程序,將五個人的名字打印出來.并按名次排序后將5行數據仍然保存到a.txt中.使文件按名次排列每行.


2,07010188,0711,李鎮豪,
1,07010154,0421,陳亦良,
3,07010194,0312,凌瑞松,
4,07010209,0351,羅安祥,
5,07010237,0961,黃世傳,

8.寫一個函數,判斷一個unsigned char 字符有幾位是1.

? 寫一個函數判斷計算機的字節存儲順序是升序(little-endian)還是降序(big-endian).

?9.微軟的筆試題.

Implement a string class in C++ with basic functionality like comparison, concatenation,
?input and output. Please also provide some test cases and using scenarios (sample code of using this class).

Please do not use MFC, STL and other libraries in your implementation.

10.有個數組a[100]存放了100個數,這100個數取自1-99,且只有兩個相同的數,剩下的98個數不同,
寫一個搜索算法找出相同的那個數的值.(注意空間效率時間效率盡可能要低).

這十道題還是能夠看出自己的水平如何的.如果你能不假思索地做出這10道題,估計去國外大公司是沒有問題了,呵呵.

答案我在整理中,以后陸續發布.................

下面有些題也不錯,可以參考.


1.下面的代碼輸出是什么,為什么?
?????? void foo(void)
?????? {
??????????? unsigned int a = 6;
??????????? int b = -20;
??????????? (a+b>6)?puts(">6"):puts("<=6");//puts為打印函數
?????? }
輸出 >6.

a+b這里做了隱式的轉換,把int轉化為unsigned int?
編譯器就會把b當作一個很大正數

2. b)運行下面的函數會有什么結果?為什么?
?????? void foo(void)
????????? {
?????????????? char string[10],str1[10];
?????????????? int i;
?????????????? for(i=0;i<10;i++)
?????????????? {
??????????????????? str1[i] = 'a';
?????????????? }
?????????????? strcpy(string, str1);
?????????? printf("%s",string);
????????? }

str1沒有結束標志,因此陷入死循環

char * strcpy(char * strDest,const char * strSrc)
{
? if ((strDest == NULL) || (strSrc == NULL))?
?   throw "Invalid argument(s)";
? char * strDestCopy = strDest;?
? while ((*strDest++ = *strSrc++) != '/0');?
  return strDestCopy;
}

由于str1末尾沒有'/0’結束標志,所以strcpy不知道拷貝到何時結束.
printf函數,對于輸出char* 類型,
順序打印字符串中的字符直到遇到空字符('\0')或已打印了由精度指定的字符數為止.

下面是微軟的兩道筆試題....

3. Implement a string class in C++ with basic functionality like comparison,?
concatenation, input and output. Please also provide some test cases and using scenarios (sample code of using this class).

Please do not use MFC, STL and other libraries in your implementation.

我的實現方案如下,這道題真地對c++的主要特性都進行了較好地考察.

String.h:

#ifndef STRING_H
#define STRING_H

#include <iostream>
using namespace std;

class String{
?? public:
??? String();
?????? String(int n,char c);
??? String(const char* source);
??? String(const String& s);
??? //String& operator=(char* s);
??? String& operator=(const String& s);
??? ~String();

??? char& operator[](int i){return a[i];}
??? const char& operator[](int i) const {return a[i];}//對常量的索引.
??? String& operator+=(const String& s);
??? int length();

?? friend istream& operator>>(istream& is, String& s);//搞清為什么將>>設置為友元函數的原因.
?? //friend bool operator< (const String& left,const String& right);
?? friend bool operator> (const String& left, const String& right);//下面三個運算符都沒必要設成友元函數,這里是為了簡單.
?? friend bool operator== (const String& left, const String& right);
?? friend bool operator!= (const String& left, const String& right);
?? private:
??? char* a;
??? int size;
};

#endif


String.cpp:


#include "String.h"
#include <cstring>
#include <cstdlib>

String::String(){
??? a = new char[1];
??? a[0] = '/0';
??? size = 0;
}

String::String(int n,char c){
?a = new char[n + 1];
?memset(a,c,n);
?a[n] = '/0';
?size = n;
}

String::String(const char* source){
?if(source == NULL){
? a = new char[1];
? a[0] = '/0';
? size = 0;
?}
?else
?{?? size = strlen(source);
? a = new char[size + 1];
? strcpy(a,source);
?}
}

String::String(const String& s){
?size = strlen(s.a);//可以訪問私有變量.
?a = new char[size + 1];
?//if(a == NULL)
?strcpy(a,s.a);
}

?

String& String::operator=(const String& s){
?if(this == &s)
? return *this;
?else
?{
? delete[] a;
??????? size = strlen(s.a);
? a = new char[size + 1];
? strcpy(a,s.a);
? return *this;
?}
}
String::~String(){
?delete[] a;//?????
}

String& String::operator+=(const String& s){
? int j = strlen(a);
? int size = j + strlen(s.a);
? char* tmp = new char[size+1];
? strcpy(tmp,a);
? strcpy(tmp+j,s.a);
?delete[] a;
?a = tmp;

?return *this;
?}

int String::length(){
?return strlen(a);
}

main.cpp:

#include <iostream>
#include "String.h"

using namespace std;

bool operator==(const String& left, const String& right)
{
?int a = strcmp(left.a,right.a);
??? if(a == 0)
? return true;
?else
? return false;
}
bool operator!=(const String& left, const String& right)
{
?return? !(left == right);
}

ostream& operator<<(ostream& os,String& s){
?int length = s.length();
?for(int i = 0;i < length;i++)
? //os << s.a[i];這么不行,私有變量.
? os << s[i];
?return os;
}


String operator+(const String& a,const String& b){
?String temp;
?temp = a;
?temp += b;
?return temp;

}

bool operator<(const String& left,const String& right){
?
?int j = 0;
?while((left[j] != '/0') && (right[j] != '/0')){
? if(left[j] < right[j])
?? return true;
? else
? {
?? if(left[j] == right[j]){
??? j++;
??? continue;
?? }
?? else
??? return false;
? }
?}
?if((left[j] == '/0') && (right[j] != '/0'))
? return true;
?else
? return false;
}

bool operator>(const String& left, const String& right)
{?? int a = strcmp(left.a,right.a);
??? if(a > 0)
? return true;
?else
? return false;
?
}

istream& operator>>(istream& is, String& s){
?delete[] s.a;
?s.a = new char[20];
?int m = 20;
??? char c;
?int i = 0;
?while (is.get(c) && isspace(c));
??? if (is) {
? do {s.a[i] = c;
?????? i++;
??? /*if(i >= 20){
????? cout << "Input too much characters!" << endl;
????? exit(-1);
??? }*/
??? if(i == m - 1 ){
???? s.a[i] = '/0';
???? char* b = new char[m];
???? strcpy(b,s.a);
???????????????? m = m * 2;
??????? s.a = new char[m];
???? strcpy(s.a,b);
???? delete[] b;
??? }
? }
? while (is.get(c) && !isspace(c));
??????? //如果讀到空白,將其放回.
? if (is)
?? is.unget();
?}
?s.size = i;
?s.a[i] = '/0';
?return is;
}


int main(){
?String a = "abcd";
?String b = "www";
?//String c(6,b);這么寫不對.
??? String c(6,'l');
?String d;
?String e = a;//abcd
?String f;
?cin >> f;//需要輸入...
?String g;
?g = a + b;//abcdwww

?if(a < b)
? cout << "a < b" << endl;
?else
? cout << "a >= b" << endl;
?if(e == a)
? cout << "e == a" << endl;
?else
? cout << "e != a" << endl;
?
?b += a;
?
?cout << a << endl;
?cout << b << endl;
??? cout << c << endl;
?cout << d << endl;
?cout << e << endl;
?cout << f << endl;
?cout << g << endl;
?cout << g[0] << endl;
?return 0;
}


?

?

4. Implement a single-direction linked list sorting algorithm.
?Please first define the data structure of linked list and then implement the sorting algorithm.

?

5.編寫一個函數,返回兩個字符串的最大公串!例如,“adbccadebbca”和“edabccadece”,返回“ccade”

?

聯想筆試題
  1.設計函數 int atoi(char *s)。

?int atoi(const char *nptr);
?函數說明
?atoi()會掃描參數nptr字符串,跳過前面的空格字符,直到遇上數字或正負符號才開始做轉換,
而再 遇到非數字或字符串結束時('/0')才結束轉換,并將結果返回。
返回值 返回轉換后的整型數。

#include <stdio.h>
#include <ctype.h>

int myAtoi(const char* s){
?int result = 0;
?int flag = 1;
?int i = 0;
?while(isspace(s[i]))
? i++;
?if(s[i] == '-'){
? flag = -1;
? i++;
?}
?if(s[i] == '+')
? i++;
?while(s[i] != '/0'){
? if((s[i] > '9') || (s[i] < '0'))
?? break;
? int j = s[i] - '0';
? result = 10 * result + j;
? i++;
?}
?result = result * flag;
?return result;
}

int main(){
?char* a = "?? -1234def";
?char* b = "+1234";
?int i = myAtoi(a);
?int j = myAtoi(b);
?printf("%d /n",i);
?printf("%d",j);
?return 0;
}


?

?

?


  2.int i=(j=4,k=8,l=16,m=32); printf(“%d”, i); 輸出是多少?
?????? 輸出32
  3.解釋局部變量、全局變量和靜態變量的含義。
?????? 他們是相對于生命周期說的,全局變量伴隨著程序直到最后,局部變量離開的作用域就會銷毀
?????? 靜態變量分為靜態局部變量和靜態全局變量,他們的生命周期伴隨著程序直到最后,二者的區別
?????? 在可見性
  4.解釋堆和棧的區別。
?????? 棧的存儲容量比堆的存儲容量小
?????? 棧上的數據可以自動釋放,堆上的必須由程序員釋放
  5.論述含參數的宏與函數的優缺點。
?????? 宏的優點:執行效率高
?????? 宏的缺點:容易出錯
    函數的優點:不容易出錯
    函數的確定 執行效率低
  普天C++筆試題
  1.實現雙向鏈表刪除一個節點P,在節點P后插入一個節點,寫出這兩個函數。
  2.寫一個函數,將其中的/t都轉換成4個空格。
  3.Windows程序的入口是哪里?寫出Windows消息機制的流程。
  4.如何定義和實現一個類的成員函數為回調函數?
  5.C++里面是不是所有的動作都是main()引起的?如果不是,請舉例。
  6.C++里面如何聲明const void f(void)函數為C程序中的庫函數?
  7.下列哪兩個是等同的
  int b;
  A const int* a = &b;
  B const* int a = &b;
  C const int* const a = &b;
  D int const* const a = &b;
  8.內聯函數在編譯時是否做參數類型檢查?
  void g(base & b){
   b.play;
  }
  void main(){
   son s;
   g(s);
   return;
  }
華為筆試題
  1.請你分別畫出OSI的七層網絡結構圖和TCP/IP的五層結構圖。
  2.請你詳細地解釋一下IP協議的定義,在哪個層上面?主要有什么作用?TCP與UDP呢?
  3.請問交換機和路由器各自的實現原理是什么?分別在哪個層次上面實現的?
  4.請問C++的類和C里面的struct有什么區別?
  5.請講一講析構函數和虛函數的用法和作用。
  6.全局變量和局部變量有什么區別?是怎么實現的?操作系統和編譯器是怎么知道的?
  7.8086是多少位的系統?在數據總線上是怎么實現的?
Sony筆試題
  1.完成下列程序
  *
  *.*.
  *..*..*..
  *...*...*...*...
  *....*....*....*....*....
  *.....*.....*.....*.....*.....*.....
  *......*......*......*......*......*......*......
  *.......*.......*.......*.......*.......*.......*.......*.......
  #include <stdio.h>
  #define N 8
  int main()
  {
   int i;
   int j;
   int k;
   ---------------------------------------------------------
   | |
   | |
   | |
   ---------------------------------------------------------
   return 0;
  }
  2.完成程序,實現對數組的降序排序
  #include <stdio.h>
  void sort( );
  int main()
  {
   int array[]={45,56,76,234,1,34,23,2,3}; //數字任//意給出
   sort( );
   return 0;
  }
  void sort( )
  {
   ____________________________________
   | |
   | |
   |-----------------------------------------------------|
  }
  3.費波那其數列,1,1,2,3,5……編寫程序求第十項。可以用遞歸,也可以用其他方法,但要說明你選擇的理由。
  #include <stdio.h>
  int Pheponatch(int);
  int main()
  {
   printf("The 10th is %d",Pheponatch(10));
   return 0;
  }
  int Pheponatch(int N)
  {
  --------------------------------
  | |
  | |
  --------------------------------
  }
  4.下列程序運行時會崩潰,請找出錯誤并改正,并且說明原因。
  #include <stdio.h>
  #include <malloc.h>
  typedef struct{
   TNode* left;
   TNode* right;
   int value;
  } TNode;
  TNode* root=NULL;
  void append(int N);
  int main()
  {
   append(63);
   append(45);
   append(32);
   append(77);
   append(96);
   append(21);
   append(17); // Again, 數字任意給出
  }
  void append(int N)
  {
   TNode* NewNode=(TNode *)malloc(sizeof(TNode));
   NewNode->value=N;
  
   if(root==NULL)
   {
   root=NewNode;
   return;
   }
   else
   {
   TNode* temp;
   temp=root;
   while((N>=temp.value && temp.left!=NULL) || (N<temp. value && temp. right!=NULL
  ))
   {
   while(N>=temp.value && temp.left!=NULL)
   temp=temp.left;
   while(N<temp.value && temp.right!=NULL)
   temp=temp.right;
   }
   if(N>=temp.value)
   temp.left=NewNode;
   else
   temp.right=NewNode;
   return;
   }
  }


MSRA Interview Written Exam(December 2003,Time:2.5 Hours)


1寫出下列算法的時間復雜度。?
(1)冒泡排序;?
(2)選擇排序;?
(3)插入排序;?
(4)快速排序;?
(5)堆排序;?
(6)歸并排序;

2寫出下列程序在X86上的運行結果。

struct mybitfields?
{?
unsigned short a : 4;?
unsigned short b : 5;?
unsigned short c : 7;?
}test

void main(void)??
{?
int i;?
test.a=2;?
test.b=3;?
test.c=0;

i=*((short *)&test);?
printf("%d/n",i);?
}

3寫出下列程序的運行結果。

unsigned int i=3;?
cout<<i * -1;

4寫出下列程序所有可能的運行結果。

int a;?
int b;?
int c;

void F1()?
{?
b=a*2;?
a=b;?
}

void F2()?
{?
c=a+1;?
a=c;?
}

main()?
{?
a=5;?
//Start F1,F2 in parallel?
F1(); F2();?
printf("a=%d/n",a);?
}

5考察了一個CharPrev()函數的作用。

6對 16 Bits colors的處理,要求:?
(1)Byte轉換為RGB時,保留高5、6bits;?
(2)RGB轉換為Byte時,第2、3位置零。

7一個鏈表的操作,注意代碼的健壯和安全性。要求:?
(1)增加一個元素;?
(2)獲得頭元素;?
(3)彈出頭元素(獲得值并刪除)。

8一個給定的數值由左邊開始升位到右邊第N位,如?
0010<<1 == 0100?
或者?
0001 0011<<4 == 0011 0000?
請用C或者C++或者其他X86上能運行的程序實現。

附加題(只有在完成以上題目后,才獲準回答)?
In C++, what does "explicit" mean? what does "protected" mean?

1。在C++中有沒有純虛構造函數??
2。在c++的一個類中聲明一個static成員變量有沒有用??
3。在C++的一個類中聲明一個靜態成員函數有沒有用??
4。如何實現一個非阻塞的socket??
5。setsockopt, ioctl都可以對socket的屬性進行設置,他們有什么不同??
6。解釋一下進程和線程的區別??
7。解釋一下多播(組播)和廣播的含義??
8。多播采用的協議是什么??
9。在c++中純虛析構函數的作用是什么?請舉例說明。?
10。編程,請實現一個c語言中類似atoi的函數功能(輸入可能包含非數字和空格) ?

本文來自互聯網用戶投稿,該文觀點僅代表作者本人,不代表本站立場。本站僅提供信息存儲空間服務,不擁有所有權,不承擔相關法律責任。
如若轉載,請注明出處:http://www.pswp.cn/news/457933.shtml
繁體地址,請注明出處:http://hk.pswp.cn/news/457933.shtml
英文地址,請注明出處:http://en.pswp.cn/news/457933.shtml

如若內容造成侵權/違法違規/事實不符,請聯系多彩編程網進行投訴反饋email:809451989@qq.com,一經查實,立即刪除!

相關文章

第五次作業

學習時間新增代碼行博客發表量知識總結 第十周5801HTML5 C和C 一般用于服務端的服務程序開發&#xff0c;硬件編程開發&#xff0c;系統等等大量框架要用到的。JAVA&#xff0c;學好這個可以開發移動設備程序&#xff0c;JSP網頁程序。C#&#xff0c;學了這個可以開發Winform&a…

數字信號處理的fpga實現_FPGA數字信號處理:通信類I/Q信號及產生

大俠好&#xff0c;歡迎來到FPGA技術江湖&#xff0c;江湖偌大&#xff0c;相見即是緣分。大俠可以關注FPGA技術江湖&#xff0c;在“闖蕩江湖”、"行俠仗義"欄里獲取其他感興趣的資源&#xff0c;或者一起煮酒言歡。大俠好&#xff0c;“寧夏李治廷”再一次和各位見…

iic通訊協議

IIC總線 一般串行數據通訊都有時鐘和數據之分,有異步和同步之別. 有單線,雙線和三線等. I2C肯定是2線的(不算地線). I2C協議確實很科學,比3/4線的SPI要好,當然線多通訊速率相對就快了. I2C的原則是: 在SCL1(高電平)時,SDA千萬別忽悠!!! 否則,SDA下跳則"判罰"為&…

使用 Python 切割圖片

剛好我有張 PNG 圖片需要均勻切割&#xff0c;剛好我不會 PhotoShop&#xff0c;剛好我想用 Python 來練練手。 于是擼袖子碼腳本。 import os from PIL import Imagedef splitimage(src, rownum, colnum, dstpath):img Image.open(src)w, h img.sizeif rownum < h and co…

python數據分析知識點_Python數據分析--Pandas知識點(三)

本文主要是總結學習pandas過程中用到的函數和方法, 在此記錄, 防止遺忘. 下面將是在知識點一, 二的基礎上繼續總結. 前面所介紹的都是以表格的形式中展現數據, 下面將介紹Pandas與Matplotlib配合繪制出折線圖, 散點圖, 餅圖, 柱形圖, 直方圖等五大基本圖形. Matplotlib是python…

SPI通訊協議

SPI&#xff1a;高速同步串行口。是一種標準的四線同步雙向串行總線。 SPI&#xff0c;是英語Serial Peripheral interface的縮寫&#xff0c;顧名思義就是串行外圍設備接口。是Motorola首先在其MC68HCXX系列處理器上定義的。SPI接口主要應用在 EEPROM&#xff0c;FLASH&#x…

基于MVVM的知乎日報應用安卓源碼

使用data binding , dagger2 , retrofit2和rxjava實現的&#xff0c;基于MVVM的知乎日報APP運行效果&#xff1a; <ignore_js_op> 使用說明&#xff1a; 項目結構android data binding來實現MVVM。dagger2來完成依賴注入。retrofit2rxjava實現restful的http請求。第三方類…

F#創建者Don Syme談F#設計原則

在.Net Fringe 2016大會上&#xff0c;F#創建者Don Syme談了他對F#現狀的看法以及F#的二元性。F#是以一個為面向對象語言構建的運行時為基礎構建的函數式語言。\\F#是2010年發布的&#xff0c;遵循開源許可協議。F#比.Net更早地踏上了開源之路&#xff0c;C#和.Net在2015年才開…

php簽入html出來的影響seo嗎_搜索引擎優化_SEO必備6大技能+SEO誤區講解!

大家好&#xff0c;我是逆冬&#xff0c;今天來分享一下實戰SEO需要掌握什么樣的技能以及SEO知識誤區&#xff0c;本篇文章僅代表逆冬本人幾年的經驗、不見得適合每一個SEOer!下面就讓逆冬本人來分析一下實戰型SEO到底需要掌握什么技能。第1點&#xff1a;SEO需要不需要熟練掌握…

編寫linux驅動程序步驟

一、建立Linux驅動框架&#xff08;裝載、卸載Linux驅動&#xff09; Linux內核在使用驅動時首先要裝載驅動&#xff0c;在裝載過程中進行一些初始化動作&#xff08;建立設備文件、分配內存等&#xff09;&#xff0c;在驅動程序中需提供相應函數來處理驅動初始化工作&#xf…

一種M2M業務的架構及實現M2M業務的方法

http://www.cnblogs.com/coryxie/p/3849764.html 技術領域 [0001] 本發明涉及通信技術領域&#xff0c;尤其涉及一種M2M業務的架構及實現M2M業務的方法。 背景技術 [0002] 隨著通信技術的飛速發展以及通信技術與互聯網技術的進一步融合&#xff0c;移動業務以及移動互聯網技術普…

第二章 mybatis使用注解實現in查詢(mysql)

mybatis實現in查詢&#xff0c;兩種方法&#xff1a; xml形式&#xff08;推薦&#xff09;注解方式&#xff08;個人喜歡注解&#xff0c;但是in場景可能不太適合注解&#xff09;代碼&#xff1a; 1 Select("<script>" 2 "SELECT ID…

python面試代碼題_python面試基礎篇80題

1.為什么學習python?3.Python和Java、PHP、C、C#、C等其他語言的對比&#xff1f; C語言由于其底層操作特性和歷史的積累&#xff0c;在嵌入式領域是當之無愧的王者。 PHP跨平臺&#xff0c;性能優越&#xff0c;跟linux/unix結合比跟windows結合性能強45%,開發成本低,php5已經…

主設備號與次設備號以及申請

一個字符設備或者塊設備都有一個主設備號和次設備號。主設備號和次設備號統稱為設備號。主設備號用來表示一個特定的驅動程序。次設備號用來表示使用該驅動程序的各設備。例如一個嵌入式系統&#xff0c;有兩個LED指示燈&#xff0c;LED燈需要獨立的打開或者關閉。那么&#xf…

javascript 變量作用域

為什么80%的碼農都做不了架構師&#xff1f;>>> javascript中的變量的作用域不同于java/c的變量規則。 1、在java/c中&#xff0c;如果有一個全局變量與一個局部變量重名&#xff0c;那么在局部變量的作用域中&#xff0c;局部變量會覆蓋掉全局變量的值。當離開局部…

七月算法--12月機器學習在線班-第五次課筆記—回歸

七月算法--12月機器學習在線班-第五次課筆記—回歸 七月算法&#xff08;julyedu.com&#xff09;12月機器學習在線班學習筆記 http://www.julyedu.com 轉載于:https://www.cnblogs.com/sweet-dew/p/5491271.html

集合添加元素python_Python基礎:列表、字典、元組、集合、添加和刪除元素,增刪...

列表&#xff08;有序&#xff09; 添加 list.append(元素)&#xff1a;在列表末尾添加新的元素 list.extend(seq)&#xff1a;在列表末尾一次性追加另一個序列中的多個值 –seq可以是列表、元組、字典&#xff0c;若為字典,則僅會將鍵(key)作為元素依次添加至原列表的末尾。 l…

file_operations結構體分析 (設備文件的操作)

linux設備驅動中file_operations結構體分析 struct module *owner第一個 file_operations 成員根本不是一個操作; 它是一個指向擁有這個結構的模塊的指針. 這個成員用來在它的操作還在被使用時阻止模塊被卸載. 幾乎所有時間中, 它被簡單初始化為 THIS_MODULE, 一個在 <Linux…

公司網絡搭建及×××到公司配置

一、公司路由器及子網配置公司192.168.1.0/24子網用于服務器集群&#xff0c;192.168.0.0/24子網用于辦公子網&#xff0c;兩個子網物理上不在一塊。公司開業時&#xff0c;申請了電信40Mbps專線光纖&#xff0c;5個IP地址&#xff0c;網關&#xff1a;*.168.112.9 255.255.25…

js——全選框 checkbox

一直會碰見input 全選框的問題&#xff0c;先整理一種情況&#xff1a; 1. <input id"selectAll" type"checkbox" />全選 2. <input typecheckbox idid1 namecb value1 />value1 <input typecheckbox idid2 namecb value2 />value2 &…