Hi,
Is it possible for a user to input a string without allocating memory
space for the string?
I try something like this:
[code]
#include <stdio.h>
#include <stdlib.h>
#include <conio.h>
#include <math.h>
#include <iostream.h>
#include <iomanip>
#include <ctype.h>
#include <string.h>
main()
{
char *text;
printf("\nEnter text: ");
scanf("%s", pt);
printf("%s", pt);
return (0);
}
[\code]
but i got this error when i run:
"The instruction at "0x00401f24" referenced memory at "0xffffffcc". The memoty could not be "written"."
It compile and build without any problems.



LinkBack URL
About LinkBacks



If you mean without the programmer explicitly allocating memory then it is possible: