ifstream* Segmentation fault [closed]

In your code, i is a pointer and it is not initialized, so the memory location it points to is indeterminate. Next, you are attempting to dereference it in (*i)….., which, invokes undefined behavior. You need to allocate memory (i.e., make the pointer point to some valid memory location) before you can dereference the pointer.

Same thing like C++ pointer in Java

Java’s pointers (so called by the language specification, while I believe Java programmers mostly know them as “references”) do not support pointer arithmetic. And Java has no way to do pointer arithmetic. If you want to do such low-level stuff in Java, one way is to use JNI (the Java Native Interface) to access code … Read more

What is pointer to string in C?

argv is an array of pointers pointing to zero terminated c-strings. I painted the following pretty picture to help you visualize something about the pointers. And here is a code example that shows you how an operating system would pass arguments to your executable. You can call your executable via command line and add any … Read more