concatenation - A more elegant way to concatenate C strings in C++? -


I was wondering if this was the least to do .... I have an assignment that puts the credit card information in the UDP packet, with a separate notification by the colon in buffer, so that it looks like Bob Jones: 7845 6133 7889 4425: 09/2017: 654.99 stored In a single character array.

  int main (int argc, char ** argv) {four buffers [256]; Four names [64]; Four card new [32]; Four Ends [8]; Four zodiac sign [14]; While (true) {/ ********* (input prompt go here, break on leaving user type) ******** / strcpy (buffer, amount); Int length = Strellan (buffer); Buffer [length] = ':'; Dome (buffer, cardam); Length = stellen (buffer); Buffer [length] = ':'; Dome (buffer, name); Length = stellen (buffer); Buffer [length] = ':'; Dome (buffer, end); / ****************************************************************************** All networking codes );    

C ++ In, you can add std :: string to attach + , or A to the object.

In both C and C ++ you have access to the formatted output, which I think it has been liked, because the whole code is neatly fitted, a single row: < pre> sprintiff (buffer, "% s:% s:% s:% s", volume, card name, name, expiration);

Comments

Popular posts from this blog

Java - Error: no suitable method found for add(int, java.lang.String) -

java - JPA TypedQuery: Parameter value element did not match expected type -

c++ - static template member variable has internal linkage but is not defined -