Announcement

Collapse
No announcement yet.

Quick question for pointers and referencies

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Quick question for pointers and referencies

    Hi!
    Code:
        FTurnBased_QueueElem *currentTop;
        FTurnBased_QueueElem *testElement;
        FTurnBased_QueueElem tempElem;
    Can this:

    Code:
                        memcpy(&tempElem, currentTop, sizeof(TurnBased_QueueElem));
                        memcpy(currentTop, testElement, sizeof(TurnBased_QueueElem));
                        memcpy(testElement, &tempElem, sizeof(TurnBased_QueueElem));
    be rewritten as:

    Code:
                        tempElem = &currentTop;
                        currentTop = testElement;
                        testElement = &tempElement;
    ??
Working...
X