Thread: passing an int array into function

  1. #1
    Registered User
    Join Date
    Mar 2004

    passing an int array into function

    int  cbarray[20] = 
    void checkall()			
    {int i=0;
    	for(i=0; i<21 < i++)
    		SendDlgItemMessage(hwnd,cbarray[i], BM_SETSTATE, (WPARAM)TRUE, 0);
    on msdn
    says that the identifier of the control is of type "int"
    so i put the identifiers into an array of type int and try to pass into a "for" loop
    but doesnt work.......
    getting " error C2440: 'initializing' : cannot convert from 'char [12]' to 'unsigned int'
    This conversion requires a reinterpret_cast, a C-style cast or function-style cast"

    any idea??

  2. #2
    and the hat of int overfl Salem's Avatar
    Join Date
    Aug 2001
    The edge of the known universe
    No idea

    But "IDC_CHECK1", isn't an int, its a string

    Given the type of the array, perhaps you meant

    However, the name of the array suggests strings, so perhaps it should be
    char *cbarray[20] =
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Undefined Reference Compiling Error
    By AlakaAlaki in forum C++ Programming
    Replies: 1
    Last Post: 06-27-2008, 11:45 AM
  2. <Gulp>
    By kryptkat in forum Windows Programming
    Replies: 7
    Last Post: 01-14-2006, 01:03 PM
  3. Replies: 4
    Last Post: 11-23-2003, 07:15 AM
  4. Interface Question
    By smog890 in forum C Programming
    Replies: 11
    Last Post: 06-03-2002, 05:06 PM
  5. My graphics library
    By stupid_mutt in forum C Programming
    Replies: 3
    Last Post: 11-26-2001, 06:05 PM