No one has voted on any posts yet. Votes from other community members are used to determine a member's reputation amongst their peers.
student
- Interests
- C++ and Linux
12 Posted Topics
Hello,everybody! I'm writing a LAN communication programming,and I need to transport a file between different host computer. I know that the TCP is a kind of stream-oriented connection.But look at the fallowing codes: [code=cplusplus] void TripPlanner::sendRequest() { QByteArray block; QDataStream out(&block, QIODevice::WriteOnly); out.setVersion(QDataStream::Qt_4_1); out << quint16(0) << quint8('S') << fromComboBox->currentText() … | |
Hello,everybody! I write my first Python script in file [B]Fibonacci.py[/B] in Linux as the fallowing: [CODE]a,b = 0,1 while b < 10: print b a,b = b,a+b[/CODE] When I want to run it,I must input these command in the command line: > python Fibonacci.py I want to know what should … | |
I am sorry for that I have solved it, just missing a ";" when I define the class. I have re-edited this thread. So sorry for flippancy! | |
Hello! I want to implement a avltree using C++,and I have do most of it,except the remove() algorithm. My question is when should I rotate the tree in remove(). I hope that any body can represent the situation for me using the Pelple's language,because the implemented code depend on the … | |
Hi,sir.I encounterred a person who said that C++ is an unsafe language.I try the follow code ,but when I input an non-int type,the program will fall in a bad loop.(gcc4.1 in Linux) [CODE] #include <iostream> #include <string> using namespace std; class bot { private: int password; public: bot():password(567){} virtual ~bot(){}; … | |
Hi,sir,please look at this code. [code] #include <iostream> using namespace std; class A{ private: class B; public: int out(int x){ return outB(x)->a; } B * outB(int x); private: B* root; class B{ int a; B(int init_a) :a(init_a){} friend class A; }; }; A::B* A::outB(int x){ root = new B(x); return … | |
This codeblock comes from Mr Weiss's book "Data Sturucture and Algorithm Analysis in C++"(Third Edition). I have some questions about it. [code=c] /** *This is a member function from the BinarySearchTree class. *And It try to find whether there's a element equal to x in *the binary search tree. */ … | |
Re: I like qt which is a C++ GUI class libarary. Qt's assistant may be a good tutorial for you! Good luck! | |
I don't ensure whether "0" or "NULL" is better to be an empty point's value in C++. Could anybody can tell me,and why? Then how about it in C, why? Thank you! | |
I don't know how to sparate the interface and their implement.And I need some help from you.For example,I hope anybody can tell me,how to make these three files to work well. [CODE] //This file named main.cpp #include <iostream> #include "ABC.h" using namespace std; int main(void) { char y='y'; char e='e'; … | |
Re: //This is my code to solve your question.Want a go? [CODE=cpp] #include <iostream> using namespace std; int main() { int num; cout<<"Enter a factorial "; cin>>num; for(int line=1;line<=num;line++){ int list=line; for(int temp1=1;temp1<list;temp1++){ cout<<' '; } for(int temp2=list;temp2<num;temp2++) cout<<temp2; for(int temp3=num;temp3>=list;temp3--) cout<<temp3; cout<<endl; } }[/CODE] |
The End.