Posts
 
Reputation
Joined
Last Seen
0 Reputation Points
Unknown Quality Score

No one has voted on any posts yet. Votes from other community members are used to determine a member's reputation amongst their peers.

0 Endorsements
~2K People Reached
Favorite Forums
Favorite Tags
c++ x 13
c x 5
Member Avatar for djbsabkcb

Below is my source code for a tictactoe program. However, my output after first move always states invalid choice, no matter what number I enter? [code] #include <iostream> #include <string> #include <cmath> using namespace std; class TicTacToe { public: TicTacToe(); // constructor int Pick_Player(); // member function int Pick_Row(); // …

Member Avatar for Narue
0
768
Member Avatar for wu7jian

[code] #include<algorithm> #include<string> #include<vector> #include<functional> #include<iostream> using namespace std; class WordCompare:binary_function<string,string,bool> { public: bool operator()(const string&a ,const string& b) { if(a.at(0)==b.at(0)) return true; else return false; } }; int main() { vector<string>MainText; vector<string>TempString; vector<string>::iterator i; MainText.push_back("All"); MainText.push_back("art"); MainText.push_back("is"); MainText.push_back("quite"); MainText.push_back("useless"); TempString.push_back("quite"); TempString.push_back("unique"); i=search (MainText.begin(),MainText.end(),TempString.begin(), TempString.end(),WordCompare()); if(i==MainText.end()) cout<<"The substring is not …

Member Avatar for Stoned_coder
0
114
Member Avatar for wu7jian

for example double t[]={0.12,0.3,7.0,4,4}; or int t[]={1,2,3,4} i wanna ask what "t+1"stand for respectively.if t is the first adress of a array,then t+1 will get to another physical adress right?a back to back address?thanks.

Member Avatar for wu7jian
0
184
Member Avatar for wu7jian

printf("%c was appended to arr\n",*(char*)p); header <stdio.h> i met a lot of this kind of situation.what are these "%d,%c"stand for? is there a detailed list about this? thank you very much!

Member Avatar for Dave Sinkula
0
136
Member Avatar for wu7jian

[code]#include<stdlib.h> #include<stdio.h> #ifndef COMPARE_H #define COMPARE_H using namespace std; int compare(const void* pfirst,const void *psecond); #endif int compare(const void* pfirst,const void *psecond) { const int first=*((const int *) pfirst); const int second=*((const int *) psecond); return(first-second); } void main() { int iarr[10]={9,83,100,1,645,-7654,4,23,543,9}; int j=0; for(;j<10;j++) printf("element %d of iarr is:%d\n",j,iarr[j]); …

Member Avatar for Lerner
0
189
Member Avatar for wu7jian

#include<iostream> #include<string> using namespace std; void main() { string str="hello world"; string::const_iterator p=str.begin(); while(p!=str.end()) { cout<<*P<<endl; p++; } } when i try to run this program.it doesn't working. it tells me the 'p' is not declared identifier. string::const_iterator p//the defination is wrong?

Member Avatar for wu7jian
0
176
Member Avatar for wu7jian

#include<iostream> using namespace std; class linkedlist {private: llink* firstelem; ..................................... struct llink { int elem; llink* nextelem; } ......................................//when i take the struct out the class definition , the program works well.but just like this it doesn't working! i am confused . ........................................................................... public: linkedlist(void); ~linkedlist(void); void AddElement(int elem1); void …

Member Avatar for wu7jian
0
146
Member Avatar for wu7jian

hi guys i don't understand the following clause. LargeStruct *s=(LargeStruct *)0; here LargeStruct is defined as following: struct LargeStruct { double bigd1[MAX_ELEMENTS]; double bigd2[MAX_ELEMENTS]; double bigd3[MAX_ELEMENTS]; double bigd4[MAX_ELEMENTS]; }; could you explain that for me?thanks.why not just: LargeStruct * s?

Member Avatar for wu7jian
0
164