1

I have a A.c file that contains some char* variable str1. I have a B.c file that contains some f() function, that make some transformation on a char* variable.

My point is: How can I pass the value of str to B.c, then compute the new string thanks to f(), and afterwards send back the new string value to A.c ?

Ganesh
  • 5,880
  • 2
  • 36
  • 54
TheForbidden
  • 1,533
  • 4
  • 22
  • 30

1 Answers1

2

For example:

// file: A.c

char* str1;

and

// file: B.c

extern char* str1;

void f(void)
{
  str1 = "blah";
}
Alexey Frunze
  • 61,140
  • 12
  • 83
  • 180