Hello,
I am new to C++. I have read the warnings about homework and do TRY.... I am an older student and have been trying to get this project going to no avail.... My first part of this code is attempting to create a grid of 16 playing cards laid out 4x4..... so on an x, y axis...[I]Card_face[/I] has been commented out....as I can't even get syntax for [I]card_value[/I] yet...however, I had planned to use a for loop for [I]card_face[/I] (which will be a function that would hide all cards from user by placing them face down - except a chosen pair). Can anyone help me with these errors>?> I've tried rearranging array values, adding and removing function names, and so on....
Thank you very much,
RiCk
1>------ Build started: Project: ArrayProject, Configuration: Debug Win32 ------
1>Compiling...
1>HomeworkProject.cpp
1>l:\prgm pjts\arrayproject\arrayproject\homeworkproject.cpp(7) : error C2040: 'card_value' : 'int [4][4]' differs in levels of indirection from 'int'
1>l:\prgm pjts\arrayproject\arrayproject\homeworkproject.cpp(9) : error C2109: subscript requires array or pointer type
1>l:\prgm pjts\arrayproject\arrayproject\homeworkproject.cpp(9) : fatal error C1903: unable to recover from previous error(s); stopping compilation
1>Build log was saved at "file://l:\Prgm Pjts\ArrayProject\ArrayProject\Debug\BuildLog.htm"
1>ArrayProject - 3 error(s), 0 warning(s)
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
.
#include <iostream>
using namespace std;
int card_value, card_face, card_value;
//int card_face [4][4];
int card_value[4][4];
int fill_values(card_value[4][4]);
int main()
{
int fill_values(card_value[][])
card_value[0][0]=1;
card_value[0][1]=2;
card_value[0][2]=3;
card_value[0][3]=4;
card_value[1][0]=5;
card_value [1][1]=6;
card_value [1][2]=7;
card_value [1][3]=8;
card_value [2][0]=9;
card_value [2][1]=10;
card_value [2][2]=11;
card_value [2][3]=12;
card_value [3][0]=13;
card_value [3][1]=14;
card_value [3][2]=15;
card_value [3][3]=16;
return 0;
}
//card_face [i][j]=0
//for(i = 0; i < 4; i++)
// for(j = 0; j< 4; j++)