yeah, just use int val[128]; then initialize it with something like:
for (int i=0;i<128;i++)
{
val[i]=0;
}


Thanks,
Tyler Littlefield
Web: tysdomain.com
email: [email protected]
My programs don't have bugs, they're called randomly added features.

  ----- Original Message ----- 
  From: Jos Timanta Tarigan 
  To: [email protected] 
  Sent: Saturday, April 04, 2009 3:52 PM
  Subject: [c-prog] error in making array in header file



  hi, 

  im having trouble to solve this error. i built a header file like this;

  #ifndef CONTROL_H
  #define CONTROL_H

  #include "includes.h"

  class Control {
  public:

  private:
  bool g_Keys[128] = {false};
  };

  #endif

  its very simple: its a class that have an array of array of boolean. those 
syntax supposed to create a 128 length boolean array with all value set to 
false. but i seem to have these errors:

  error: a brace-enclosed initializer is not allowed here before '{' token
  error: ISO C++ forbids initialization of member 'g_Keys'
  error: making 'g_Keys' static
  error: invalid in-class initialization of static data member of non-integral 
type 'bool [128]'

  did i miss anything?

  thanks in advance :)



  

[Non-text portions of this message have been removed]

Reply via email to