sorry - i was still reading and editing my first post...

with declaration i meant string fname("aaa"), didn't look familiar, but its ok. i recommend anyway that you use the same environment as in class and make sure you got the same header files, specially when you're new to all this. spares you from a lot of confusion

or perhaps your teacher wants you to modify the string class?