2 Replies - 3067 Views - Last Post: 11 October 2013 - 10:18 PM Rate Topic: -----

#1 blueblueblue   User is offline

  • New D.I.C Head

Reputation: 1
  • View blog
  • Posts: 3
  • Joined: 11-October 13

Error... undeclared (first use in this function)

Posted 11 October 2013 - 10:12 PM

I'm having trouble where when I compile, I get an error that says

error: 'this_STACK' undeclared (first use in this function)
  return this_STACK;


here is the function it is from


Stack * new_Stack (unsigned long stacksize) {
	/* allocate */
	void *memory = malloc((stacksize+3) * sizeof(long));
	Stack *this_Stack = (Stack*)memory + STACK_OFFSET;

	/* initialize */
	this_Stack[STACK_COUNT_INDEX] = 1;
	this_Stack[STACK_SIZE_INDEX] = size;
	this_Stack[STACK_POINTER_INDEX] = -1;

	return this_STACK;
}


Is This A Good Question/Topic? 0
  • +

Replies To: Error... undeclared (first use in this function)

#2 Salem_c   User is offline

  • void main'ers are DOOMED
  • member icon

Reputation: 2186
  • View blog
  • Posts: 4,250
  • Joined: 30-May 10

Re: Error... undeclared (first use in this function)

Posted 11 October 2013 - 10:16 PM

> 09 this_Stack[STACK_POINTER_INDEX] = -1;
10
> 11 return this_STACK;
It's case sensitive!
Was This Post Helpful? 1
  • +
  • -

#3 blueblueblue   User is offline

  • New D.I.C Head

Reputation: 1
  • View blog
  • Posts: 3
  • Joined: 11-October 13

Re: Error... undeclared (first use in this function)

Posted 11 October 2013 - 10:18 PM

Oh sorry. I can't believe I missed that. Thanks
Was This Post Helpful? 1
  • +
  • -

Page 1 of 1