while(*str) {
if (*str == 'y')
*str++ = '@';
else
str++
}
void main() {
printf("%s", *&"test");
}
void main() {
char *str = "helloy world";
for(;*str; ++str)
printf(str);
}
#include <stdio.h>
char *map[50][50];
int main(void) {
char exit[100];
char *desc;
strcpy(exit, "East");
map[0][0] = exit;
desc = map[0][0];
strcat(desc, " - To Tom Bombidil's house.");
printf("%s <- updated.", map[0][0]);
return 0;
}
// OUTPUT => "East - To Tom Bombidil's house. <- updated."
char * map[50][50]; //is an array of pointers to chars.
if( map[x][y] )
free(map[x][y]);
map[x][y] = strdup("{d|{x");
void main() {
I figured I would go ahead and open a thread because I will have plenty of questions I'm sure.
My first is why this doesn't work:
This is odd because by assigning str = &orig;, I assumed that would be the same memory address.
What am I missing here?