#include"stdafx.h"
#include<cstdlib>
#include<iostream>
usingnamespace std;
int tmain(int argc, _TCHAR* argv[])
{
// Let's Declare Variables
int Num_Pegs; // Total number of pegs to a side
int Hold_Und; // Hold underscore location
// User Enters Number of Pegs
cout <<"Enter Number of Pegs:";
cin >>Num_Pegs;
// Array to create a board
char board[Num_Pegs * 2];
// Fill Array
for (int b = 0; b < Num_Pegs; b++)
For some reason, I keep getting an error from VC++ compiler saying "Expected a constant expression"? Also cannot allocate "size 0 array"?
When I run this program (Full Code) in DevC+, I have no problem!? But of course it has to be done in VC++ WIN32. Any help would be great!
spankyg 0 Light Poster
spankyg 0 Light Poster
vijayan121 1,152 Posting Virtuoso
jtorjo 0 Newbie Poster
spankyg 0 Light Poster
Narue 5,707 Bad Cop Team Colleague
ShawnCplus 456 Code Monkey Team Colleague
spankyg 0 Light Poster
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.