Click here to Skip to main content
15,891,431 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: Process hirarchy Pin
Aqueel8-Mar-06 1:47
Aqueel8-Mar-06 1:47 
GeneralRe: Process hirarchy Pin
jhwurmbach8-Mar-06 2:48
jhwurmbach8-Mar-06 2:48 
AnswerRe: Process hirarchy Pin
David Crow8-Mar-06 2:32
David Crow8-Mar-06 2:32 
GeneralRe: Process hirarchy Pin
Aqueel8-Mar-06 2:45
Aqueel8-Mar-06 2:45 
GeneralRe: Process hirarchy Pin
jhwurmbach8-Mar-06 2:52
jhwurmbach8-Mar-06 2:52 
GeneralRe: Process hirarchy Pin
David Crow8-Mar-06 2:53
David Crow8-Mar-06 2:53 
QuestionUsing HTTP_QUERY_CONTENT_MD5 Pin
bosfan7-Mar-06 23:19
bosfan7-Mar-06 23:19 
QuestionReading from file - newbie Pin
antonaras_marcou7-Mar-06 23:01
antonaras_marcou7-Mar-06 23:01 
Hi i'm new to c++
and i'm trying to read from a file character by character and output the result on the console.
This is my code:::
#include <stdio.h>
#include<iostream.h>


int in_tags(FILE *pFile)
{
char t;
cout<<"in tags";
t=getc(pFile);
cout<<t;
while="" (t="getc(pFile)!='">')
{

cout<<t;
}
="" return="" 0;
}




int="" main="" ()
{
="" file="" *="" pfile;
="" char="" c;
="" bool="" tag;

="" pfile="fopen("example.txt","r");
" if="" (pfile="=NULL)" perror="" ("error="" opening="" file");
="" else
="" {
="" do="" c="getc" (pfile);
="" cout<<c;
="" if(c="='<')
" tag="in_tags(pFile);
" }="" while="" (c="" !="EOF);
" fclose=""
="" 0;
}
the="" output::
ok<in="" tagsi&#9786;&#9786;&#9786;&#9786;&#9786;ok="" ok="" ok<in="" tagsi&#9786;&#9786;&#9786;&#9786;&#9786;<in="" press="" any="" key
to="" continue

the="" file::
ok<inside="">ok ok ok<inside><inside>ok ok ok ok

The output that i get from the main program is ok
but when are coming from the function within the while loop
the caracters are lost and i get symbols.
I hope i'm clear enough but i don't think so but in case you know how to help me pls reply as this is for a project that i'm doing for college
thanks in advance!
AnswerRe: Reading from file - newbie Pin
Aqueel7-Mar-06 23:51
Aqueel7-Mar-06 23:51 
GeneralRe: Reading from file - newbie Pin
antonaras_marcou8-Mar-06 0:07
antonaras_marcou8-Mar-06 0:07 
GeneralRe: Reading from file - newbie Pin
antonaras_marcou8-Mar-06 0:22
antonaras_marcou8-Mar-06 0:22 
GeneralRe: Reading from file - newbie Pin
David Crow8-Mar-06 2:39
David Crow8-Mar-06 2:39 
GeneralRe: Reading from file - newbie Pin
antonaras_marcou8-Mar-06 5:29
antonaras_marcou8-Mar-06 5:29 
GeneralRe: Reading from file - newbie Pin
Eytukan8-Mar-06 0:31
Eytukan8-Mar-06 0:31 
GeneralRe: Reading from file - newbie Pin
antonaras_marcou8-Mar-06 1:33
antonaras_marcou8-Mar-06 1:33 
GeneralRe: Reading from file - newbie Pin
Eytukan8-Mar-06 2:06
Eytukan8-Mar-06 2:06 
GeneralRe: Reading from file - newbie Pin
toxcct8-Mar-06 1:29
toxcct8-Mar-06 1:29 
GeneralRe: Reading from file - newbie Pin
antonaras_marcou8-Mar-06 1:36
antonaras_marcou8-Mar-06 1:36 
AnswerRe: Reading from file - newbie Pin
Aqueel8-Mar-06 0:19
Aqueel8-Mar-06 0:19 
AnswerRe: Reading from file - newbie Pin
Aqueel8-Mar-06 0:28
Aqueel8-Mar-06 0:28 
AnswerRe: Reading from file - newbie Pin
Stephen Hewitt8-Mar-06 0:41
Stephen Hewitt8-Mar-06 0:41 
QuestionWhat is UnPaged memory Pin
Neil scsn7-Mar-06 22:21
Neil scsn7-Mar-06 22:21 
AnswerRe: What is UnPaged memory Pin
Stephen Hewitt7-Mar-06 22:47
Stephen Hewitt7-Mar-06 22:47 
GeneralRe: What is UnPaged memory Pin
Neil scsn7-Mar-06 22:53
Neil scsn7-Mar-06 22:53 
GeneralRe: What is UnPaged memory Pin
Stephen Hewitt8-Mar-06 0:27
Stephen Hewitt8-Mar-06 0:27 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.