•
•
•
•
What is DaniWeb IT Discussion Community?
You're currently browsing the C section within the Software Development category of DaniWeb, a massive community of 429,896 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 2,452 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our C advertiser: Programming Forums
Views: 746 | Replies: 4
•
•
Join Date: Sep 2007
Posts: 17
Reputation:
Rep Power: 2
Solved Threads: 0
I have to pass a string to a function that strcats something to it, in K&R I read to pass a pointer to it, but I don't know where to allocate buffer...
Is there a difference betw passing an empty string or not?
My printf starts with some strange symbols, and then the string...
Is there a difference betw passing an empty string or not?
My printf starts with some strange symbols, and then the string...
c Syntax (Toggle Plain Text)
int main() { char *string; //here or in string_concat? or both? string = (char*) malloc(16 * sizeof(char)); string_concat( &string ); printf("%s", string); return 0; } void string_concat( char **string ) { //write in string something, need a realloc? strcat(*string, something); }
•
•
•
•
•
•
•
•
DaniWeb C Marketplace
•
•
•
•
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
Similar Threads
- string arrays: storing input (C++)
- pass the value to the text box (JavaScript / DHTML / AJAX)
- How do you pass objects as arguements? (Java)
- C++ BASICS ==> Pointers, Call by Reference/Value, Inheritance, Functions & Arrays (C++)
- need help understandin how to pass by reference. (Java)
- need help in creating class string (C++)
Other Threads in the C Forum
- Previous Thread: Passing type as a parameter; generalised linked list in C?
- Next Thread: Need help on my assignment !!! - about file streams :((



Threaded Mode