Jump to content

Definir array usando array de constante.... Pode ? Como ?


Helio

Recommended Posts

Boa tarde pessoal, estou precisando de ajuda com a declaração de uma variável int...

Tenho um array de 10 posições do tipo 'const ' e preciso usar cada uma das posições para definir o tamanho de uma variável array int...

Mas não está funcionando...

O que eu fiz :

#define _GNU_SOURCE // necessário porque getline() é extensão GNU
#include<stdio.h>
#include<stdlib.h>
#include<string.h>
#include<iostream>
#include<fstream>
#include<math.h>
#include <limits>
#include <windows.h>

const int IND_TAM=5,  /* ESTE EU VOU MUDAR 'A MÃO' EM CADA EXECUÇÃO */

              MAX_TAM[10]={10,15,200,300,320,410,770,400,220,90}

int VETOR_INTERNO[MAX_TAM[IND_TAM]], CONTADOR_INTERNO, CONTADOR_EXTERNO;

....

Mas o Code Blocks emite erro... "VETOR_INTERNO NÃO FOI DECLARADO"

Tem como resolver ? ? ?

Abraços, Hélio

Edited by M6
Formatação de código.
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site you accept our Terms of Use and Privacy Policy. We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.