Connecting Tech Pros Worldwide Help | Site Map

log file

 
LinkBack Thread Tools Search this Thread
  #1  
Old July 19th, 2005, 07:12 PM
hallosenthil
Guest
 
Posts: n/a
Default log file


1) i want to know how to create a log file in c++?



give me example or show me the site link



2) how to create a 2-d array of characters in a structure where the
values of the arrays are taken from the external file



can anyone help me





thanks in advance


--
Posted via http://dbforums.com

  #2  
Old July 19th, 2005, 07:12 PM
Bob Smith
Guest
 
Posts: n/a
Default Re: log file



hallosenthil wrote:
[color=blue]
> 1) i want to know how to create a log file in c++?[/color]

you could use cerr to stream to any file

[color=blue]
>
>
>
> give me example or show me the site link
>
>
>
> 2) how to create a 2-d array of characters in a structure where the
> values of the arrays are taken from the external file
>
>
>
> can anyone help me[/color]

you could use a vector of vectors.
/B

[color=blue]
>
>
>
>
>
> thanks in advance
>
>
> --
> Posted via http://dbforums.com
>[/color]

  #3  
Old July 19th, 2005, 07:12 PM
Mike Wahler
Guest
 
Posts: n/a
Default Re: log file


"hallosenthil" <member38057@dbforums.com> wrote in message
news:3478762.1066127057@dbforums.com...[color=blue]
>
> 1) i want to know how to create a log file in c++?
> give me example or show me the site link[/color]

Example:

#include <fstream>

int main()
{
std::ofstream logfile("filename");
return 0;
}
[color=blue]
> 2) how to create a 2-d array of characters in a structure where the
> values of the arrays are taken from the external file[/color]

Example:

#include <fstream>

int main()
{
struct
{
char array[10][10];
} data = {0};

std::ifstream external("filename");

if(external)
external.read(reinterpret_cast<char *>(data.array),
sizeof data.array);

return 0;
}


-Mike


 

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Popular Articles

What is Bytes?

We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights. Get the best answers to your questions from over 220,989 network members.