找回密碼
 立即注冊

QQ登錄

只需一步,快速開始

搜索
查看: 3903|回復(fù): 23
收起左側(cè)

有大佬讓我重新把整個C語言學(xué)一遍

  [復(fù)制鏈接]
ID:886945 發(fā)表于 2021-5-31 03:04 來自手機 | 顯示全部樓層 |閱讀模式
         當(dāng)初在學(xué)校的時候,開的C語言的課,基本也就只是學(xué)一學(xué)if else for這些加上一些思維邏輯方面的基礎(chǔ)的東西,現(xiàn)在自學(xué)單片機,一套32的入門視頻下來,跟著單片機學(xué)的C,整套視頻里邊關(guān)于C的知識也都能看懂.指針結(jié)構(gòu)體什么的還是能看簡單用一用.
         結(jié)果這兩天去面試,大佬給我一份基本純C的筆試題,結(jié)果好像只能做出不到一半的題目...
         他讓我回去重新把整套C學(xué)一遍直到自己能夠調(diào)試到單鏈表的增、刪、改、寫 為止,有大佬有推薦哪個視頻嘛!
回復(fù)

使用道具 舉報

ID:155507 發(fā)表于 2021-5-31 08:22 | 顯示全部樓層
可供參考

C語言學(xué)習(xí)資料推薦
http://www.torrancerestoration.com/bbs/dpj-198731-1.html
回復(fù)

使用道具 舉報

ID:844772 發(fā)表于 2021-5-31 08:24 | 顯示全部樓層
會結(jié)構(gòu)和指針,就應(yīng)該會操作單鏈表,不用老是浪費時間看視頻,太慢了,頂多看看例程,關(guān)鍵是自己在腦子里多想,自己給自己出題。鏈表操作,無論單雙還是樹都是基本操作,沒有技術(shù)含量。
回復(fù)

使用道具 舉報

ID:414556 發(fā)表于 2021-5-31 23:08 | 顯示全部樓層
買本C語言的書。結(jié)合視頻鞏固知識。
回復(fù)

使用道具 舉報

ID:930497 發(fā)表于 2021-6-1 10:01 | 顯示全部樓層
直接去b站找吧,c語言教程多的是,建議直接看書,邊學(xué)邊做,兩三周就差不多
回復(fù)

使用道具 舉報

ID:930641 發(fā)表于 2021-6-1 14:17 | 顯示全部樓層
可以去mooc上看看浙江大學(xué)的c語言基礎(chǔ)課程,單鏈表的增刪查改涉及到一些數(shù)據(jù)結(jié)構(gòu)的知識,可以去看一下王道考研數(shù)據(jù)結(jié)構(gòu)
回復(fù)

使用道具 舉報

ID:155507 發(fā)表于 2021-6-2 08:28 | 顯示全部樓層
我給你來個程序試試
單鏈表的增、刪

  1. /*
  2. 單鏈表的增、刪
  3. */
  4. #include<stdlib.h>
  5. #include <stdio.h>

  6. void create();
  7. void display();
  8. void insert_begin();
  9. void insert_end();
  10. void insert_pos();
  11. void delete_begin();
  12. void delete_end();
  13. void delete_pos();


  14. struct node
  15. {
  16.         int info;
  17.         struct node *next;
  18. };
  19. struct node *start=NULL;
  20. int main()     
  21. {
  22.         int choice;
  23.         while(1){
  24.                
  25.                 printf("n                MENU                             n");
  26.                 printf("n 1.Create     n");
  27.                 printf("n 2.Display    n");
  28.                 printf("n 3.Insert at the beginning    n");
  29.                 printf("n 4.Insert at the end  n");
  30.                 printf("n 5.Insert at specified position       n");
  31.                 printf("n 6.Delete from beginning      n");
  32.                 printf("n 7.Delete from the end        n");
  33.                 printf("n 8.Delete from specified position     n");
  34.                 printf("n 9.Exit       n");
  35.                 printf("n--------------------------------------n");
  36.                 printf("Enter your choice:t");
  37.                 scanf("%d",&choice);
  38.                 switch(choice)
  39.                 {
  40.                 case 1:
  41.                         create();
  42.                         break;
  43.                 case 2:
  44.                         display();
  45.                         break;
  46.                 case 3:
  47.                         insert_begin();
  48.                         break;
  49.                 case 4:
  50.                         insert_end();
  51.                         break;
  52.                 case 5:
  53.                         insert_pos();
  54.                         break;
  55.                 case 6:
  56.                         delete_begin();
  57.                         break;
  58.                 case 7:
  59.                         delete_end();
  60.                         break;
  61.                 case 8:
  62.                         delete_pos();
  63.                         break;
  64.                        
  65.                 case 9:
  66.                         exit(0);
  67.                         break;
  68.                        
  69.                 default:
  70.                         printf("n Wrong Choice:n");
  71.                         break;
  72.                 }
  73.         }
  74.         return 0;
  75. }
  76. void create()
  77. {
  78.         struct node *temp,*ptr;
  79.         temp=(struct node *)malloc(sizeof(struct node));
  80.         if(temp==NULL)
  81.         {
  82.                 printf("nOut of Memory Space:n");
  83.                 exit(0);
  84.         }
  85.         printf("nEnter the data value for the node:t");
  86.         scanf("%d",&temp->info);
  87.         temp->next=NULL;
  88.         if(start==NULL)
  89.         {
  90.                 start=temp;
  91.         }
  92.         else
  93.         {
  94.                 ptr=start;
  95.                 while(ptr->next!=NULL)
  96.                 {
  97.                         ptr=ptr->next;
  98.                 }
  99.                 ptr->next=temp;
  100.         }
  101. }
  102. void display()
  103. {
  104.         struct node *ptr;
  105.         if(start==NULL)
  106.         {
  107.                 printf("nList is empty:n");
  108.                 return;
  109.         }
  110.         else
  111.         {
  112.                 ptr=start;
  113.                 printf("nThe List elements are:n");
  114.                 while(ptr!=NULL)
  115.                 {
  116.                         printf("%dt",ptr->info );
  117.                         ptr=ptr->next ;
  118.                 }
  119.         }
  120. }
  121. void insert_begin()
  122. {
  123.         struct node *temp;
  124.         temp=(struct node *)malloc(sizeof(struct node));
  125.         if(temp==NULL)
  126.         {
  127.                 printf("nOut of Memory Space:n");
  128.                 return;
  129.         }
  130.         printf("nEnter the data value for the node:t" );
  131.         scanf("%d",&temp->info);
  132.         temp->next =NULL;
  133.         if(start==NULL)
  134.         {
  135.                 start=temp;
  136.         }
  137.         else
  138.         {
  139.                 temp->next=start;
  140.                 start=temp;
  141.         }
  142. }
  143. void insert_end()
  144. {
  145.         struct node *temp,*ptr;
  146.         temp=(struct node *)malloc(sizeof(struct node));
  147.         if(temp==NULL)
  148.         {
  149.                 printf("nOut of Memory Space:n");
  150.                 return;
  151.         }
  152.         printf("nEnter the data value for the node:t" );
  153.         scanf("%d",&temp->info );
  154.         temp->next =NULL;
  155.         if(start==NULL)
  156.         {
  157.                 start=temp;
  158.         }
  159.         else
  160.         {
  161.                 ptr=start;
  162.                 while(ptr->next !=NULL)
  163.                 {
  164.                         ptr=ptr->next ;
  165.                 }
  166.                 ptr->next =temp;
  167.         }
  168. }
  169. void insert_pos()
  170. {
  171.         struct node *ptr,*temp;
  172.         int i,pos;
  173.         temp=(struct node *)malloc(sizeof(struct node));
  174.         if(temp==NULL)
  175.         {
  176.                 printf("nOut of Memory Space:n");
  177.                 return;
  178.         }
  179.         printf("nEnter the position for the new node to be inserted:t");
  180.         scanf("%d",&pos);
  181.         printf("nEnter the data value of the node:t");
  182.         scanf("%d",&temp->info) ;

  183.         temp->next=NULL;
  184.         if(pos==0)
  185.         {
  186.                 temp->next=start;
  187.                 start=temp;
  188.         }
  189.         else
  190.         {
  191.                 for(i=0,ptr=start;i<pos-1;i++) { ptr=ptr->next;
  192.                         if(ptr==NULL)
  193.                         {
  194.                                 printf("nPosition not found:[Handle with care]n");
  195.                                 return;
  196.                         }
  197.                 }
  198.                 temp->next =ptr->next ;
  199.                 ptr->next=temp;
  200.         }
  201. }
  202. void delete_begin()
  203. {
  204.         struct node *ptr;
  205.         if(ptr==NULL)
  206.         {
  207.                 printf("nList is Empty:n");
  208.                 return;
  209.         }
  210.         else
  211.         {
  212.                 ptr=start;
  213.                 start=start->next ;
  214.                 printf("nThe deleted element is :%dt",ptr->info);
  215.                 free(ptr);
  216.         }
  217. }
  218. void delete_end()
  219. {
  220.         struct node *temp,*ptr;
  221.         if(start==NULL)
  222.         {
  223.                 printf("nList is Empty:");
  224.                 exit(0);
  225.         }
  226.         else if(start->next ==NULL)
  227.         {
  228.                 ptr=start;
  229.                 start=NULL;
  230.                 printf("nThe deleted element is:%dt",ptr->info);
  231.                 free(ptr);
  232.         }
  233.         else
  234.         {
  235.                 ptr=start;
  236.                 while(ptr->next!=NULL)
  237.                 {
  238.                         temp=ptr;
  239.                         ptr=ptr->next;
  240.                 }
  241.                 temp->next=NULL;
  242.                 printf("nThe deleted element is:%dt",ptr->info);
  243.                 free(ptr);
  244.         }
  245. }
  246. void delete_pos()
  247. {
  248.         int i,pos;
  249.         struct node *temp,*ptr;
  250.         if(start==NULL)
  251.         {
  252.                 printf("nThe List is Empty:n");
  253.                 exit(0);
  254.         }
  255.         else
  256.         {
  257.                 printf("nEnter the position of the node to be deleted:t");
  258.                 scanf("%d",&pos);
  259.                 if(pos==0)
  260.                 {
  261.                         ptr=start;
  262.                         start=start->next ;
  263.                         printf("nThe deleted element is:%dt",ptr->info  );
  264.                         free(ptr);
  265.                 }
  266.                 else
  267.                 {
  268.                         ptr=start;
  269.                         for(i=0;i<pos;i++) { temp=ptr; ptr=ptr->next ;
  270.                                 if(ptr==NULL)
  271.                                 {
  272.                                         printf("nPosition not Found:n");
  273.                                         return;
  274.                                 }
  275.                         }
  276.                         temp->next =ptr->next ;
  277.                         printf("nThe deleted element is:%dt",ptr->info );
  278.                         free(ptr);
  279.                 }
  280.         }
  281. }
復(fù)制代碼
回復(fù)

使用道具 舉報

ID:932858 發(fā)表于 2021-6-4 14:12 | 顯示全部樓層
我覺得學(xué)C看書蠻快的,我覺得視頻比較拖,耽誤時間,樓主已經(jīng)有基礎(chǔ)來了。看書完全可以勝任
回復(fù)

使用道具 舉報

ID:883242 發(fā)表于 2021-6-4 15:37 | 顯示全部樓層
看大佬的意思不是說你c語言不行,而是沒看過《數(shù)據(jù)結(jié)構(gòu)》這種編程基礎(chǔ)知識。
回復(fù)

使用道具 舉報

ID:933203 發(fā)表于 2021-6-5 09:23 | 顯示全部樓層
推薦The_C_Programming_Language這本書,有電子中文版的
回復(fù)

使用道具 舉報

ID:933229 發(fā)表于 2021-6-5 14:55 來自手機 | 顯示全部樓層
慕課里就有
回復(fù)

使用道具 舉報

ID:934580 發(fā)表于 2021-6-8 08:32 | 顯示全部樓層
要快。我覺得邊做題邊學(xué)更好。去樂扣刷題。不會的就研究。有點基礎(chǔ)的話不怕
回復(fù)

使用道具 舉報

ID:940357 發(fā)表于 2021-6-19 12:30 | 顯示全部樓層
看書加看視頻 效果更好
回復(fù)

使用道具 舉報

ID:937320 發(fā)表于 2021-6-20 07:28 | 顯示全部樓層
c的primer 書就可以了。C語言有技術(shù),再重新學(xué)一下也很快 。但不重學(xué)的話,知識不全。其實有針對性的,學(xué)不會的就好
回復(fù)

使用道具 舉報

ID:886945 發(fā)表于 2021-12-23 04:09 | 顯示全部樓層
angmall 發(fā)表于 2021-6-2 08:28
我給你來個程序試試
單鏈表的增、刪

哈哈,半年后才重新回來看帖子...粗略的看了一下,雖然這半年也沒怎么寫程序,但是結(jié)構(gòu)體指針這些都還算能接受了...主要還是需要多看看別人代碼...
回復(fù)

使用道具 舉報

ID:139866 發(fā)表于 2021-12-23 09:44 | 顯示全部樓層
sdarling 發(fā)表于 2021-12-23 04:09
哈哈,半年后才重新回來看帖子...粗略的看了一下,雖然這半年也沒怎么寫程序,但是結(jié)構(gòu)體指針這些都還算 ...

你以為你懂了,其實沒有,程序是寫出來的不是看出來的
回復(fù)

使用道具 舉報

ID:748788 發(fā)表于 2021-12-23 14:13 | 顯示全部樓層
對源程序做一些修改,看自己能否再獨立寫出完整的程序
回復(fù)

使用道具 舉報

ID:996200 發(fā)表于 2021-12-23 19:42 | 顯示全部樓層
你去慕課上看各大高校的課
回復(fù)

使用道具 舉報

ID:996353 發(fā)表于 2021-12-23 23:29 | 顯示全部樓層
會結(jié)構(gòu)和指針,就應(yīng)該會操作單鏈表,基本上嗶哩嗶哩可以自學(xué)
回復(fù)

使用道具 舉報

ID:86450 發(fā)表于 2021-12-24 08:11 | 顯示全部樓層
都會指針了,好強。  我寫單片機邏輯業(yè)務(wù)簡單的 ,從來不用指針。  看多一個多級菜單程序用過指針?戳撕镁貌琶靼自趺椿厥。
回復(fù)

使用道具 舉報

ID:514901 發(fā)表于 2021-12-24 17:56 | 顯示全部樓層
數(shù)據(jù)結(jié)構(gòu)而已,本質(zhì)還是結(jié)構(gòu)體與指針
回復(fù)

使用道具 舉報

ID:415064 發(fā)表于 2021-12-24 19:47 | 顯示全部樓層
直接去B站找郝斌C語言和數(shù)據(jù)結(jié)構(gòu),你現(xiàn)在是ifelseswitch, 那么你缺的是精華部分->指針,內(nèi)存,數(shù)據(jù)結(jié)構(gòu)的鏈表隊列,算法里面的排序、濾波,代碼規(guī)范、再來點實際應(yīng)用的PID,wifi這些就基本就差不多
回復(fù)

使用道具 舉報

ID:816989 發(fā)表于 2021-12-24 20:57 | 顯示全部樓層
建議看C Primer,這本書對學(xué)習(xí)C語言新手有幫助的。而且,常用的代碼函數(shù)會在這本書上找,還可以當(dāng)作查字典。
回復(fù)

使用道具 舉報

ID:382454 發(fā)表于 2021-12-24 21:13 來自手機 | 顯示全部樓層
買書,買學(xué)習(xí)版,看例程,自己開發(fā)多實操練練就上手快。
回復(fù)

使用道具 舉報

您需要登錄后才可以回帖 登錄 | 立即注冊

本版積分規(guī)則

手機版|小黑屋|51黑電子論壇 |51黑電子論壇6群 QQ 管理員QQ:125739409;技術(shù)交流QQ群281945664

Powered by 單片機教程網(wǎng)

快速回復(fù) 返回頂部 返回列表