0

a)how to run c++ program on Borland c package.I am preparing a graphic program on c++ but my progrm shows it can't run on windows.
b)how a pointer is un limited array.:)

2
Contributors
1
Reply
2
Views
11 Years
Discussion Span
Last Post by Ancient Dragon
0

a) I suspect you are attempting to use 16-bit borland graphics functions with a 32-bit compiler? If not then I have no idea what you mean. You will have to post actual error message(s)

b) a pointer is just the address to the beginning of an array. Of course there is a practical limit on the array's size -- nothing is infinite. But I think what they were saying is that just having the pointer along one cannot determine the array's length. If it is a pointer to a string then you can call strlen() function to get its length, but the array size can larger.

Example:

int foo( char * pointer)
{
  return strlen(pointer);
}

int main()
{
   char name[255] = "Jones";
   int len = foo(name);

   return 0;
}

In the above code function foo() returns the length of the string but has no clude about how big the array of characters.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.