1. Passing pointers.

I'm sure I'm doing something wrong here. I can't figure out what tough.

This is the function that gives trouble:
Code:
```void ten_and_up(int random, char *pjackEtc)
{
if (random == 11)
{
pjackEtc = "Jack";
puts("Jack");
}
else if (random == 12)
{
pjackEtc = "Queen";
puts("Queen");
}
else if (random == 13)
{
pjackEtc = "King";
puts("King");
}
else if (random == 14)
{
pjackEtc = "Ace";
puts("Ace");
}
else
{
puts("***Error in void ten_and_up***");
}
return;
}```
This is the prototype:
Code:
`void ten_and_up (int random, char *pjackEtc);`
And this the function call:
Code:
`ten_and_up(random, pjackEtc);`
The function executes the else statement.

Thank You.

2. And what is the value of random? Why do you think it is 11, 12, 13, or 14? Obvious thing I would do: in the error statement you're getting, print the value of random as well and see what it is. Especially given the name of the function -- ten_and_up -- I would assume that random might be ten.

3. One possible problem is that since you are just passing a pointer, assigning to the pointer in the function has no external effect. What you probably want to do instead would be along the lines of:
Code:
```void ten_and_up(int random, const char **pjackEtc)
{
if (random == 11)
{
*pjackEtc = "Jack";
puts("Jack");
}
/* ... */
}

/* ... */
ten_and_up(random, &pjackEtc);```
Alternatively, you copy the given string literal to the string that is passed, assuming that the string that pjackEtc points to has enough space for the longest possible word to be copied over.