Is it possible to read a text file without using arrays? C -


<पूर्व> #include & lt; stdio.h & gt; # शामिल करें & lt; stdlib.h & gt; Int main (int argc, const char * argv []) {FILE * f; चार * chPtr = मॉलोक (आकारफ (चार) * 1000); ///////////////// f = fopen ("input.txt", "r"); अगर (! च) वापसी 1; जबकि (fgets (* chPtr, 1000, f)! = NULL) {printf ("% c", * chPtr); } Fclose (f); Printf ("\ n% c", * (chPtr + 4)); वापसी 0; }

हमारे शिक्षक ने कहा है कि [] 'कोष्ठक' का उपयोग नहीं करते हैं, इसलिए मैं मान रहा हूं कि यह मॉलोक तक है, लेकिन क्या यह काम नहीं कर सका?

<<>>

> <<>

इस fgets (* chPtr, 1000, f) एफ) और (जैसा कि @ मैट एमकनब उल्लेखनीय है) printf ("% c", * chPtr) के साथ printf ("% s", chPtr)

Comments

Popular posts from this blog

php - PDO bindParam() fatal error -

logging - How can I log both the Request.InputStream and Response.OutputStream traffic in my ASP.NET MVC3 Application for specific Actions? -

java - Why my included JSP file won't get processed correctly? -