Results 1 to 8 of 8

Thread:

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Registered User
    Join Date: Jan:2011
    Location: bg
    Posts: 4

    1. ++, :
    a. 3 4 ;
    b. ;
    c. 1 3 ;
    d. 2 4 .

    2. , , .. .
    3. , 12 .
    4. , , .

    2- , 2- " " - ? , ?

    !

  2. #2
    philosophus duratea icaci's Avatar
    Join Date: Oct:2006
    Location: Aachen
    Posts: 2,698
    C/C++ , , :
    a[0][0], a[0][1], ..., a[0][N-1], a[1][0], a[1][1], ..., a[1][N-1], ..., a[M-1][0], a[M-1][1], ..., a[M-1][N-1]
    ( , a[M][N])
    a[i][j] i*N+j . : a[i][j] *(a + i*N+j). :
    Code:
    a[i][j] = a[i-1][j] + 5
    Code:
    *(a + i*N+j) = *(a + (i-1)*N+j) + 5
    :
    a[i] *(a+i)
    (. a[M][N][P]):
    a[i][j][k] *(a + i*N*P + j*P + k)
    Internet - it doesn't make you stupid, it just makes your stupidity more accessible to others

  3. #3
    Registered abUser ike's Avatar
    Join Date: Jul:2004
    Location: sofi
    Posts: 4,965
    Have no fear ike iz here.
    CPU Cx486DLC@40MHz, RAM 4MB, VGA Trident 512KB, HDD Conner 160MB, Monitor 14" Color

  4. #4
    Registered User
    Join Date: Jan:2011
    Location: bg
    Posts: 4
    , :
    Code:
    int arr[3][4]={0};
    for(int i=0;i<3;i++){
    	for(int g=0;g<4;g++){
    		*(arr+i*4+g)=(rand()%10);
    	}
    }
    Incompatible types in assignment of 'int' to 'int [4]'
    :/
    Code:
    int arr[3][4]={0};
    for(int i=0;i<3;i++){
    	for(int g=0;g<4;g++){
    		cout << **(arr+i*4+g)<<endl;
    	}
    }
    :
    0
    0
    0
    1879090456
    1606416496
    1606416496
    0
    1879090456
    1879090456
    1606416504
    1606416512
    0
    ?

    ---------- 15:58 ---------- 14:38 ----------

    ..
    Last edited by kokodilche; 16th January 2011 at 15:07.

  5. #5
    philosophus duratea icaci's Avatar
    Join Date: Oct:2006
    Location: Aachen
    Posts: 2,698
    :
    - int *pa = (int*)a pa a ;
    - a: *((int*)a + i*4 + g) = ...;
    - a : int a[3][4] int a[3*4].
    Internet - it doesn't make you stupid, it just makes your stupidity more accessible to others

  6. #6
    Registered User
    Join Date: Jan:2011
    Location: bg
    Posts: 4
    ,
    Code:
    cout << (arr+((1*3)+1));
    Code:
    cout << *(arr+((1*3)+1));
    Code:
    cout << **(arr+((1*3)+1));
    10 4 +1

    ---------- 16:50 ---------- 16:38 ----------

    ,
    *((int*)arr+i*4+g)
    ... . :/ , ..

  7. #7
    philosophus duratea icaci's Avatar
    Join Date: Oct:2006
    Location: Aachen
    Posts: 2,698
    , - , -. , , :
    - &a[0][0] int* ;
    - a[0] int* ;
    - *a int* ;
    - a int* .

    :
    Code:
    	int arr[3][4];
    
    	cout << arr[0]     << " " << arr[0] + 1     << endl;
    	cout << &arr[0][0] << " " << &arr[0][0] + 1 << endl;
    	cout << *arr       << " " << *arr + 1       << endl;
    	cout << (int*)arr  << " " << (int*)arr + 1  << endl;
    64- :
    Code:
    $ ./a.out 
    0x7fff5fbffad0 0x7fff5fbffad4
    0x7fff5fbffad0 0x7fff5fbffad4
    0x7fff5fbffad0 0x7fff5fbffad4
    0x7fff5fbffad0 0x7fff5fbffad4
    Internet - it doesn't make you stupid, it just makes your stupidity more accessible to others

  8. #8
    Registered User
    Join Date: Jan:2011
    Location: bg
    Posts: 4
    , .
    , , .
    2- , 3-

    ---------- 21:09 ---------- 18:29 ----------

    ,

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

Copyright © 1999-2011 . .
iskamPC.com | mobility.BG | Bloody's Techblog | | 3D Vision Blog |