Thread: Array assigning error

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Registered User
    Join Date
    Jun 2012
    Posts
    2

    Lightbulb Array assigning error

    Hi,

    while running the below mentioned code i got a error can any one help to fix these error.
    The error message is"cannot convert 'int (*)(s) to int*' in function main() " and "'p' is assigned a value that never used in function main()"

    Code:
    #include<stdio.h>
    #include<conio.h>
    main()
    {
      int s[4][2] = {
        {123, 33},
        {124, 35},
        {125, 36},
        {126, 37}
      };
      int (*p)[2];
      int i, j, *pint;
      for (i = 0; i <= 3; i++) {
        p = &s[i];
        pint = p;
        printf("\n");
        for (j = 0; j < 1; j++)
          printf("%d", *(pint + j));
      }
      getch();
      clrscr();
    }
    Last edited by Salem; 06-28-2012 at 01:04 AM. Reason: demunging useless colour

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. bus error when assigning value to member of struct
    By popapez in forum C Programming
    Replies: 4
    Last Post: 09-23-2009, 08:37 PM
  2. error in assigning a path ?
    By GSalah in forum C++ Programming
    Replies: 18
    Last Post: 11-17-2006, 04:48 PM
  3. Assigning the value of a const array to a normal array
    By Accident Prone in forum C++ Programming
    Replies: 6
    Last Post: 08-11-2003, 10:40 PM
  4. Error with assigning ..interrupt value?
    By jawwadalam in forum A Brief History of Cprogramming.com
    Replies: 1
    Last Post: 04-15-2003, 10:28 AM
  5. Assigning std::strings result in error
    By NixPhoeni in forum C++ Programming
    Replies: 4
    Last Post: 12-07-2001, 04:01 PM

Tags for this Thread