Connecting Tech Pros Worldwide Help | Site Map

log file

  #1  
Old July 19th, 2005, 08:12 PM
hallosenthil
Guest
 
Posts: n/a

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, 08:12 PM
Bob Smith
Guest
 
Posts: n/a

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, 08:12 PM
Mike Wahler
Guest
 
Posts: n/a

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


Closed Thread


Similar Threads
Thread Thread Starter Forum Replies Last Post
Separate output for log file and stdout amit.uttam@gmail.com answers 5 June 27th, 2008 05:25 PM
Creating a standard log file that is accessible by all other files indiarocks answers 7 March 30th, 2007 08:10 PM
Trimming a large log file? veg_all@yahoo.com answers 7 November 30th, 2006 08:05 PM
recycled transaction log file: too much? Hubert Fröhlich answers 1 November 23rd, 2005 01:32 AM
AutoShrink Transaction Log File Bucfan1 answers 3 July 20th, 2005 03:19 AM