1. for the compilation error you can replace that line by the
following
fout.write((char*) &rec , sizeof(rec)); //<== Here
if you want to write the data, i prefer that you write each data
member of the structure separately ;)
2. For a good C++ IDE, i prefer
Code::Blocks<http://en.wikipedia.org/wiki/Codeblocks>it's great and
cross-platform, and the 8.02 version was just released
to download here is the link <http://www.codeblocks.org/downloads/5>
Good Luck
On Sat, Mar 29, 2008 at 6:56 AM, Omar S. Hafez <[EMAIL PROTECTED]>
wrote:
>
> Actually, I'm facing a small problem with Geany as well.
>
> I'm trying to write a simple programm to write data to a file of
> records.
>
> This is the very simple code I've written:
>
> ====
>
> # include <iostream>
> # include <fstream.h>
> using namespace std;
>
> struct strecord
> {
> char name[50];
> int mark;
> int no;
> };
>
> int main()
> {
> strecord rec;
>
> ofstream fout ("stfile.txt");
> for (int i = 0; i <= 49; i++)
> {
> cin >> rec.name;
> cin >> rec.mark;
> cin >> rec.no;
> fout.write((unsigned char*) &rec , sizeof(rec)); //<== Here
> }
> fout.close();
> return 0;
> }
> ========
>
> The problem is with the line "fout.write((unsigned char*) &rec ,
> sizeof(rec));", it doesn't accept it, it says it's an invalid conversion
> from 'unsigned char*' to 'const char*'. I wonder why is that..? :\
>
>
>
> On Fri, 2008-03-28 at 10:09 +0300, هناء ناصر wrote:
> > hello again thank u my brother i could write c++ program without any
> > errors but i have project in c++ using open gl lib (glut)
> > and when i using geany i have some problem about syntax like
> > (glVertex...etc ) how can i include glut lib and write code without
> > any problem ???
> >
> > On 27/03/2008, Omar Hafez <[EMAIL PROTECTED]> wrote:
> > Salamu Alaikom.
> >
> > Look, first of all, you have to install the latest version of
> > G++ in you machine.
> >
> > Just go in the terminal and type:" sudo apt-get install g++ "
> >
> > And then regarding the compiler, I would recommend you use
> > Geany.
> >
> > It's very good and easy to use and works for almost
> > everything.
> >
> > No matter what the language you're using, just open a new file
> > in Geany, write all the code you want and
> > then save the file in the right extension. For example, if
> > your program is written is C++, just all write the
> > C++ code you want, the save the file as "file-name.cpp", if it
> > was in Python, save it as "file-name.py", and
> > so forth.
> >
> > To get Geany, just do the same thing you did for G++: "sudo
> > apt-get install geany".
> > Or, you can also find it in the Add/Remove application located
> > in the start menu.
> >
> > But remember, you have to install G++ first, in order to be
> > able to compile, build, and execute C++ code.
> >
> >
> > Good luck, and enjoy. ^_^
> >
> >
> > On Thu, Mar 27, 2008 at 7:07 PM, من أجل عالم أفضل
> > <[EMAIL PROTECTED]> wrote:
> >
> > alsalam 3lekom:
> > im student in it collage and i installed anjuta to
> > use it and stop
> > using studio 2005 but i have a problem : when i select
> > new>project>c+
> > +>> then i want workspace to write code i tried to
> > open main .cc
> > then compile it (there is no error ) then i want to
> > execute it but >>>
> > box message appeared (Program
> > '/home/hana88/Projects/foobar-cpp/src/
> > foobar-cpp' does not exists)
> > what i can do please ???
> >
> >
> >
> >
> >
> >
> >
> >
> >
> > --
> >
> http://img1.orkut.com/images/milieu/1206110058/1206135293031/155533376/Z1soemla.jpg
> > >
>
>
> >
>
--
Ramy Eid
Mobile: 0788 256 276
rmyeid.blogspot.com
/'_|/
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Jolug" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/Jolug?hl=en-GB
-~----------~----~----~----~------~----~------~--~---