You mean structure assignment?
Code:
*SecondHello = *newHello;
If you assign one structure to another, each member will be copied over. (It's what's termed a shallow copy.)
[edit] There were several other problems with your code. I'm assuming that this is what you're looking for:
Code:
#include <stdio.h>
#include <stdlib.h>
struct hello {
int test;
};
struct hello *newHello = NULL;
void outside();
int main() {
newHello = malloc(sizeof(*newHello));
newHello->test = 1980;
printf("%d\n", newHello->test); //PRINTS 1980
outside();
getchar();
return 0;
}
void outside() {
struct hello *SecondHello = malloc(sizeof(*SecondHello));
*SecondHello = *newHello;
printf("%d\n", SecondHello->test); //WONT print 1980
}
[/edit]