Results 1 to 15 of 15
Thread: visual ++
Hybrid View
-
27th December 2006 13:01 #1
visual ++
, Borland ++ . : MxN . ( 4 6 3 6 )
int n,m;
cout<<"n=";
cin>>"n=";
cout<<"m=";
cin>>"m=";
int A[m][n];
[100][100] .
.
-
27th December 2006 13:32 #2
cin? ( ++ ,
). .
btw ? ,
.. "["
EDIT: , - .. m n int . malloc/free new/delete , - .. . , - - .
-
27th December 2006 13:34 #3
++ , . . - .. 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
-
27th December 2006 14:02 #4
-
27th December 2006 14:06 #5
#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)
-
27th December 2006 14:19 #6
, .
:
int **a = new int*[m];
for (int i = 0; i < m; ++i)
a[i] = new int[n];Ar4i
-
27th December 2006 14:27 #7
-
27th December 2006 14:32 #8
-
27th December 2006 15:32 #9
-
27th December 2006 14:18 #10
- , Ar4i, $- ...
cin, :
int **A;
A = (**int) malloc(m*n*sizeof(int));
........ ( );
free(A); - , , .
, , , #include <malloc.h>
-
27th December 2006 19:18 #11
-
27th December 2006 21:40 #12
-
27th December 2006 22:37 #13
( ) ( ). ( ), ( ), "" . , ( ),
Internet - it doesn't make you stupid, it just makes your stupidity more accessible to others
-
28th December 2006 02:01 #14




Reply With Quote

Lenovo ThinkPad 15 IdeaPad 15
5th May 2023, 22:16 in