Link to home
Start Free TrialLog in
Avatar of Rad1
Rad1

asked on

How to Concat a C string with int

Hi,

How to concat a string with an int in C language?

thank you!
SOLUTION
Avatar of phoffric
phoffric

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Rad1
Rad1

ASKER

String x = "my string";
int myInt = 1;
string result;

result = strcat(x,myInt);

How can I make this work in C?

Thank you!
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
>> result = strcat(x,myInt);
BTW, strcat does not work on a C++ string type.