7.29总结

<pre name="code" class="html">

 
不知不觉,实习就过去半个月了,也正式开始接触项目,从刚开始做数据过滤,然后接触数据库。发现自己懂的确实太少。下面总结下最近遇到的问题 



1.链表中string类型赋值问题。

之前在给链表中string类型赋值,编译能通过。但是执行到那个地方会出现段错误。困扰了我很久。

后来才发现我在创建节点时用的是malloc函数,属于C语言的,而string类型属于C++,string类型的大小是不确定的

后来改为new,问题得到了解决。

head=(Node *)malloc(sizeof(Node));
改为:
<code class="c plain" style="white-space: nowrap; list-style: none; line-height: 13.2px; box-sizing: content-box !important; font-family: Consolas, "Bitstream Vera Sans Mono", "Courier New", Courier, monospace !important; padding: 0px !important; border-radius: 0px !important; margin: 0px !important; border: 0px !important; outline: 0px !important; bottom: auto !important; float: none !important; height: auto !important; left: auto !important; overflow: visible !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important; min-height: auto !important; background: none !important;">head=</code><code class="c keyword bold" style="white-space: nowrap; list-style: none; line-height: 13.2px; box-sizing: content-box !important; font-family: Consolas, "Bitstream Vera Sans Mono", "Courier New", Courier, monospace !important; padding: 0px !important; color: rgb(0, 102, 153) !important; border-radius: 0px !important; margin: 0px !important; border: 0px !important; outline: 0px !important; bottom: auto !important; float: none !important; height: auto !important; left: auto !important; overflow: visible !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important; font-weight: bold !important; min-height: auto !important; background: none !important;">new</code><span style="color: rgb(51, 51, 51); font-family: Consolas, "Bitstream Vera Sans Mono", "Courier New", Courier, monospace; line-height: 13.2px; white-space: pre;"> </span><code class="c plain" style="white-space: nowrap; list-style: none; line-height: 13.2px; box-sizing: content-box !important; font-family: Consolas, "Bitstream Vera Sans Mono", "Courier New", Courier, monospace !important; padding: 0px !important; border-radius: 0px !important; margin: 0px !important; border: 0px !important; outline: 0px !important; bottom: auto !important; float: none !important; height: auto !important; left: auto !important; overflow: visible !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important; min-height: auto !important; background: none !important;">Node();</code>


2.写点最近的想法吧

前几天有过想转为学习java的想法,可能是有点受不了c++的一些。仔细一想确实可以早点开始了解java,毕竟一门语言是不够用的。

同时最近项目开始接触数据库,用的mongochef,感觉功能挺强大的,有机会研究研究。

最后C语言基础挺重要的,写链表插入,遍历的时候还百度了几次。。

差不多这周的任务结束,不断努力!!


  • 1
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值