substitute for java '+' operator in c or c++


 
Thread Tools Search this Thread
Top Forums Programming substitute for java '+' operator in c or c++
# 1  
Old 12-30-2008
substitute for java '+' operator in c or c++

could some one suggest me the substitute for java's + operator for concatenating two strings in c and cpp languageSmilie
# 2  
Old 12-30-2008
Look for a "String" class in C++. Almost all libraries have them. The "standard" C++ library includes one. Here's a fuller answer: Cprogramming.com - C++ Standard Library - String Class
# 3  
Old 12-30-2008
C doesn't have "Strings", you can only allocate arrays of characters, which most functions expect to be \0 terminated.
# 4  
Old 12-30-2008
Quote:
Originally Posted by pludi
C doesn't have "Strings", you can only allocate arrays of characters, which most functions expect to be \0 terminated.
Right. This cannot be done in standard C. You can use C++ and use no other C++ features and you will have something almost exactly like C -- except for the overloaded String operations.
Login or Register to Ask a Question

Previous Thread | Next Thread

1 More Discussions You Might Find Interesting

1. Programming

Address operator in JAVA?

Hi friends, I hope u r doing well. Please have a look at my code, you will get my qestion. In C language, #include <stdio.h> int main() { int x = 10; printf("%d\n", &x); // print address of the variable x return 0; } In Java, (1 Reply)
Discussion started by: gabam
1 Replies
Login or Register to Ask a Question