On writing the same code in an offline IDE I am getting a parse error, Why is this so?
Parse error in offline IDE
@Ak07 I tried your code on few IDEs and on my offline IDE as well , this is working fine in all of them. It seems to be a compiler dependent error.
Nothing much can be done, still provide me the exact error code message might be able to get something out of it.
If this resolves your query mark it resolved.
zsh: parse error near `&&’
also can you explain why do we use dynamic memory for char *output=new …
one more doubt: When we declare static char*input=NULL; here input variable is declared as a pointer to a char so how can input store a string and while storing the string why are we not dereferencing it?
@Abhinav2604 char * input define a pointer of char type which point the first element of char array.
@rishabhmahajan546 I am using mingw GCC. Char * can always work as string, in C, both can be used interchangeably.
@rishabhmahajan546 sorry let me use proper terminology, by string in C i meant char array. (pointers and arrays can be used interchangeably in C as well as C++ (just that pointer needs to be a valid pointer))
I hope this clears your doubt.
also can you explain why do we use dynamic memory for char *output=new …
@Ak07 hey,dynamic memory islie li hai kyunki woh runtime pr array bna rha hai ,aisa koi jaroori nhi hai ki dynamic hi lena hai app static bhi define kr skte hai ,apki marzi hai.
I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.
On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.
but it is giving me an error when I try to use normal memory allocation rather than DMA