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
~8K People Reached
Favorite Forums
Favorite Tags
c++ x 11
c x 1
Member Avatar for newcpp

this is my codeļ¼Œ when I comment all output code(printf cout), the compiler told me "Debug Error!", why? [CODE]#include <stdio.h> #include <string.h> #include <iostream> using namespace std; int main () { char buf[]=" 1 1 1201 1 -0.349200000000000D+06 0.115200000000000D+06"; char* cpr; /* cout<<sizeof(buf)<<endl;*/ /* cout<<(buf+25)<<endl;*/ for (cpr = buf+25; cpr …

Member Avatar for newcpp
0
77
Member Avatar for newcpp

I have a problem when handling the txt file in C++. My code is like this, and the test.txt file is in the attachment. there are two functions: [LIST=1] [*]int txtnum(ifstream& input, char* filename ) is to count the amount of numbers list in the txt file. [*]long filesize( ifstream& …

Member Avatar for Ancient Dragon
0
138
Member Avatar for Wong23

Can someone help me with this problem... A is an m*n matrix B is an n*p matrix product AB is an m*p then I have to write a function void matrix product that takes two matrices of integers as two separate arguments and then calculates the product of those matrices …

Member Avatar for tintin.iitk
0
109
Member Avatar for newcpp

I have a question: [CODE]#include <stdio.h> char * chstrswithf(char * a) { while(*a!='\0') { if(*a=='s') *a='f'; a++; } return a; } int main(void) { char string[]="this is a string"; chstrswithf(string); printf("%s \n",string); return 0; }[/CODE] the code above is ok for running. but when I replace the [COLOR="Red"]char string[]="this is …

Member Avatar for gerard4143
0
82
Member Avatar for newcpp

I have a problem about std::vector as member of class, I'm not clearly about the initialization mechanism [CODE=c++]#include <iostream> #include <vector> using namespace std; class Obj; //this is a Class object class Grid { public: Grid( ) { } ~Grid( ){ } protected: private: vector<Obj> v1; //initialization mechanism ? and …

Member Avatar for newcpp
0
7K
Member Avatar for newcpp

I have a problem about memory allocated, I read through my code and think threre is no problem, but it did happens, it very confusing me ...., here is my code: the problem lies in a[] when the Class Grid wants to use it. [code=cplusplus]#include <iostream> using namespace std; typedef …

Member Avatar for Ancient Dragon
0
263
Member Avatar for newcpp

I want to plot a rectangle by mouse click in opengl. But I failed to do it, it's very comfued, by the way, the rectangle just exists in a flash, then disappear. [CODE] [COLOR="Red"]void OnMouse[/COLOR](int button, int state, int x, int y) { glRectf(a,b,0,-10); } int main(int argc, char** argv) …

Member Avatar for daviddoria
0
131