I got it. thx.
Type: Posts; User: L.O.K.
I got it. thx.
I want to make an array of pointers to (int) using "new".
int * a = new ???? ; // (int *) (99) ; ???
thx
/* If you think my question is unclear, please tell me. I am not an English...
For this diagram:
http://chorist.mis.ccu.edu.tw/teaching/CCU931-PL/final/final_5.jpg
Let's talk about the class "S" and "T" only.
Should I write like this:
class S{
public:
void setID();...
Still can not solve the problem. thx
I am using MS VC++ 6.
//==============================//
It is OK now ~~ sorry for bothering. THANKS . :p
NO, sorry, i use "int main()" in normal times.
I wrote the "void main()" this time is for quick testing.
I correct it now.
thx
I run this is OK, "d.txt" is created and "12" is appended.
#include <fstream.h>
int main(){
fstream file;
file.open( "d.txt", ios::app );
file.write( "12" ,2 );
file.close();
Thx all , I will study about these things more deeply,.
I' m sorry. I am a Chinese.
thanks for helping
how to do
printf( "%c", 50 ); and also printf( "%d", 'a' );
via
ostream cout ??
thx
thank..~
strange problem,
int main(void){
char *a = "123456";
a[2] = 'a' ;
printf( "%s", a );
oh ~~ i see , one is Global, one is not.
I saw some one write in the 2nd form. (he is not an expert); hehe!
ths
OK , i understood now. thank .'
1:
void function();
int main(void){
return 0;
}
void function(){}
Oh, thx so much.
char a[99];
sizeof(a); // <<--- How does "sizeof" work to know the no. of elements is 99 ?? I am wondering if there is a place in the memory to store the 99 ??
OK, well, now I've understood, FAQ:"The return type of main() must always be an int, this allows a return code to be passed to the invoker."
and ,i'm sorry, , What is the meaning of cast?
thx.
O~~ thx..
my Eng. is poor..
i want to ask how C knows that the no. of element is 99 ??
and ,, can we get 99 in other method of sizeof(a)/sizeof(a[0]) ??
just want to know..
int a[99];
there are 99 (int)s memory allocated.
why we use sizeof( a ) , it can output 198 ?
why it knows ? where does it store the no of elements?
//in this way:
void ChangeAddr( int **b ){
*b = (int*) malloc( ... );
}
void main(){
int *a ;
ChangeAddr( a );
thx, but how do i create CDC obj'z dynamically?
like this form ,
N = 99;
for( i=0 ; i<N ; i++){
//CDC *cdc = new CDC();
i want to make a CDC obj's Array, using MFC,
CObArray, CPtrArray, tried these 2.,
CPtrArray A;
A.Add( &CDC::CDC() );
A[0]->..... not OK
O, something new to me.
what about the
int AfxMessageBox(......);
and
char * itoa( .... .. ) ;
i always use them without catching the returns.
Ok, now i know what is wrong in my program. thank you very much!!
i know that the CDC obj. is 1x1 at first.
how to resize it ??
i can use SelectObject( BMP ) ; to resize, but i know this is a...
CDC twdc;
twdc.CreateCompatibleDC(this->GetDC());
//=== gen pattern ===//
for( int x=0 ; x<99 ; x++ ){
for( int y=0 ; y<99 ; y++ ){
twdc.SetPixelV( x,y, x*x+y*y );
}...