|
are you coding in C or C++ ?
|
|
|
|
|
i m coding in C..so cannot use STL.
|
|
|
|
|
document yourself about linked lists. they can be performed using C structures, and a set of pointers...
otherwise, you have to allocate/reallocate/free blocks of memory as you need...
|
|
|
|
|
You can use pointers if you know that.
|
|
|
|
|
Ask user approx how many char(s) his string will be. the allocate memory to a char pointer with the size specified.
char * str;
str = (char *)malloc(size);
|
|
|
|
|
Can we do it without asking the user??? Is any other Way?
|
|
|
|
|
uhhh, where is the user asked ? your program allocates memory without asking AFAIK !
|
|
|
|
|
dona jain wrote: Is any other Way?
What are you trying to achieve?
Though I speak with the tongues of men and of angels, and have not money, I am become as a sounding brass, or a tinkling cymbal. George Orwell, "Keep the Aspidistra Flying", Opening words
|
|
|
|
|
char str[100]
i dont want it this way ..i want that all the characters which a user give i/p can be allocated memory...that means we dont know yhe exact array size
|
|
|
|
|
Do you get them blockwise or char by char?
For blocks, a linked list of blocksized buffers would be the way to go.
For single chars, you could assemble blocks by yourself (get chars until you have, say, 512 and then add this buffer to your linked list and make a new buffer of size 512).
Note that there must be any amount of ready-made solutions for that on *specialized C-Programming pages*. Not in the C++/MFC forum of Codeproject.
Though I speak with the tongues of men and of angels, and have not money, I am become as a sounding brass, or a tinkling cymbal. George Orwell, "Keep the Aspidistra Flying", Opening words
|
|
|
|
|
dona jain wrote: Can we do it without asking the user??? Is any other Way?
Yes. Assign each character that the user types to a char variable. Dynamically grow an array and append the char to it each time. Note that this reeks of inefficiency.
Why don't you tell us what you are ultimately trying to achieve so that we may possibly offer a better solution?
"A good athlete is the result of a good and worthy opponent." - David Crow
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
hi masters
i have made an application in vc++ using dialog based
i have a button so i want when i click this it ask for some system ip address
and when i enter ip address and click then it connect to that system
and a window appwar for chat between those two systems
please guide me
thanks
|
|
|
|
|
p_ wrote: urgent please
What do you think where you are here?
Though I speak with the tongues of men and of angels, and have not money, I am become as a sounding brass, or a tinkling cymbal. George Orwell, "Keep the Aspidistra Flying", Opening words
|
|
|
|
|
sorry for that
i think my view goes in wrong direction
|
|
|
|
|
|
thanks for this sir
but i want it through coding in vc++
thanks
|
|
|
|
|
hye,
i m also looking for this topic...
can u send me ur project.
my id is gemini_5jun@yahoo.com
|
|
|
|
|
i am sorry becoz my project is not complete
and i am working on it
i have only forms and login coding for user
|
|
|
|
|
hi master,
hope u are still searcing for the answer, search the article in code project for vc++ code for LAN chatting .If u need the code for Internet chat please reply or mail me ...
swaroop
|
|
|
|
|
thanks sir\
please send me that sir
again thanks
|
|
|
|
|
So exactly which part do you need help with? What do you have working so far?
"A good athlete is the result of a good and worthy opponent." - David Crow
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
I am trying to debug a program in release build.
But after some time i getting a message like
"User breakpoint called from code at 0x77f813b1"
how to rectify this one?
What actually is the problem here?
Please help me.............
R@j@$eg@r
|
|
|
|
|
have you set a breakpoint somewhere ?
have you tried to step into the debugger and watch your variables to understand why it was crashing ?
BTW, what's your IDE ?
|
|
|
|
|
No, I removed all the breakpoints in my program.
Actully i am using Visual studio 6.0...
R@j@$eg@r
|
|
|
|
|