Results 1 to 15 of 15

Thread: visual ++

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Registered User stani_87's Avatar
    Join Date: Apr:2003
    Posts: 173

    visual ++

    , Borland ++ . : MxN . ( 4 6 3 6 )

    int n,m;
    cout<<"n=";
    cin>>"n=";
    cout<<"m=";
    cin>>"m=";
    int A[m][n];


    [100][100] .

    .

  2. #2
    Registered User Neverine's Avatar
    Join Date: Sep:2004
    Location: /
    Posts: 721
    cin? ( ++ , ). .
    btw ? ,

    .. "["

    EDIT: , - .. m n int . malloc/free new/delete , - .. . , - - .
    Last edited by Neverine; 27th December 2006 at 13:44.
    P5Q Deluxe | E8500 | EK-Supreme + MCP655 + MCR220 + Feser Tube | 2*2GB A-Data 800 | GB HD3850 256MB | WD6401AALS | Lite-on 20A1S | PC P&C Silencer 610W | Antec P182 | Belinea 102035
    F2 F3

  3. #3
    Master of Magic Ar4i's Avatar
    Join Date: Nov:2001
    Location:
    Posts: 6,563
    ++ , . . - .. m*n*sizeof(int) . , ++ .

    P.S. ( ++ , )

    int n,m;
    cout<<"n=";
    cin>>n;
    cout<<"m=";
    cin>>m;
    int A[m][n];

    , - .
    Last edited by Ar4i; 27th December 2006 at 13:50.
    Ar4i

  4. #4
    Registered User stani_87's Avatar
    Join Date: Apr:2003
    Posts: 173

  5. #5
    Registered User stani_87's Avatar
    Join Date: Apr:2003
    Posts: 173

    #include<iostream.h>
    int main(){
    int m,n;
    cout<<"n=";
    cin>>n;

    cout<<"m=";
    cin>>m;
    int A[m][n];
    return 0;
    }
    int A[m][n];



    --------------------Configuration: kursova - Win32 Debug--------------------
    Compiling...
    kursova.cpp
    C:\Documents and Settings\STANI\kursova.cpp(9) : error C2057: expected constant expression
    C:\Documents and Settings\STANI\kursova.cpp(9) : error C2466: cannot allocate an array of constant size 0
    C:\Documents and Settings\STANI\kursova.cpp(9) : error C2057: expected constant expression
    C:\Documents and Settings\STANI\kursova.cpp(9) : error C2466: cannot allocate an array of constant size 0
    C:\Documents and Settings\STANI\kursova.cpp(9) : error C2087: '<Unknown>' : missing subscript
    C:\Documents and Settings\STANI\kursova.cpp(9) : error C2133: 'A' : unknown size
    Error executing cl.exe.

    kursova.obj - 6 error(s), 0 warning(s)

  6. #6
    Master of Magic Ar4i's Avatar
    Join Date: Nov:2001
    Location:
    Posts: 6,563
    , .

    :

    int **a = new int*[m];
    for (int i = 0; i < m; ++i)
    a[i] = new int[n];
    Ar4i

  7. #7
    Defender Kaspirtov's Avatar
    Join Date: Jun:2006
    Location: Sf
    Posts: 7,414
    Quote Originally Posted by stani_87 View Post
    ...
    , (). ( ) - :
    Code:
    #include<iostream>
    int main(){
    	int m,n;
    
    	cout<<"n=";
    	cin>>n;
    	cout<<"m=";
    	cin>>m;
    
    	int **A;
    
            A = new int* [n];
    	for(int i = 0; i < n; i++)
    	       *(A + i) = new int [m];
    
    //     
    
            for(int i = 0; i < n; i++)
    		delete [] *( + i);
    	delete [] A;
    
    	return 0;
    }
    " , , , , ."

  8. #8
    Registered User Neverine's Avatar
    Join Date: Sep:2004
    Location: /
    Posts: 721
    Ar4i , m n. , ...
    P5Q Deluxe | E8500 | EK-Supreme + MCP655 + MCR220 + Feser Tube | 2*2GB A-Data 800 | GB HD3850 256MB | WD6401AALS | Lite-on 20A1S | PC P&C Silencer 610W | Antec P182 | Belinea 102035
    F2 F3

  9. #9
    Registered User stani_87's Avatar
    Join Date: Apr:2003
    Posts: 173
    Kaspirtov

  10. #10
    MFrost's Avatar
    Join Date: Aug:2005
    Location: /
    Posts: 203
    - , Ar4i, $- ...
    cin, :

    int **A;

    A = (**int) malloc(m*n*sizeof(int));
    ........ ( );
    free(A); - , , .

    , , , #include <malloc.h>

  11. #11
    Registered User vegasis's Avatar
    Join Date: Jun:2005
    Location:
    Posts: 1,156
    Quote Originally Posted by stani_87 View Post
    int n,m;
    cout<<"n=";
    cin>>"n=";
    cout<<"m=";
    cin>>"m=";
    int A[m][n];
    .

  12. #12
    Registered User stani_87's Avatar
    Join Date: Apr:2003
    Posts: 173
    . , . mn 55 o - . 2 . . .

  13. #13
    philosophus duratea icaci's Avatar
    Join Date: Oct:2006
    Location: Aachen
    Posts: 2,698
    ( ) ( ). ( ), ( ), "" . , ( ),
    Internet - it doesn't make you stupid, it just makes your stupidity more accessible to others

  14. #14
    Registered User stani_87's Avatar
    Join Date: Apr:2003
    Posts: 173

    ,

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 |