User Profile

Collapse

Profile Sidebar

Collapse
nomad5000
nomad5000
Last Activity: May 16 '07, 02:12 AM
Joined: Sep 17 '06
Location:
  •  
  • Time
  • Show
  • Source
Clear All
new posts

  • nomad5000
    replied to problems overloading << operator
    in C
    sorry about my ignorance, but exactly how do you declare a function a friend function

    Thanks very much!!

    Michael
    See more | Go to post

    Leave a comment:


  • nomad5000
    started a topic problems overloading << operator
    in C

    problems overloading << operator

    Hello!

    I'm trying to overload the << operator but it just won't work

    my code is the following:

    Code:
    the student.h file
    
    #include <string>
    #include <iostream>
    
    using namespace std;
    class student
    {
      private:
        string name;
        string department;
      public:
        student(string n = "", string
    ...
    See more | Go to post

  • nomad5000
    replied to directory handling in c++
    in C
    Pleas respond it´s urgent!!
    See more | Go to post

    Leave a comment:


  • nomad5000
    replied to directory handling in c++
    in C
    I'm using plain old Windows XP
    See more | Go to post

    Leave a comment:


  • nomad5000
    replied to directory handling in c++
    in C
    I would like to create a directory an later on create several files inside that directory.
    example:

    --ExampleDir
    ----ExampleFile1
    ----ExampleFile2
    ----ExampleFile3
    ----ExampleFile4...
    See more | Go to post

    Leave a comment:


  • nomad5000
    started a topic directory handling in c++
    in C

    directory handling in c++

    Helo everybody!

    I'm trying to use directory manipulation in c++ I'm using Borland c++ builder x compiler or a minimalist gnu c++ compiler and I can't find a way to be able to create and manipulate directories. I read a litlebit in the internet and found something about a library called dir.h but I can't find this library in my compiler.

    Any help will be gratly apreciated!!

    Greetings Michael
    See more | Go to post

  • nomad5000
    replied to How to use templates propperly
    in C
    I'm using Borland Win 32 compiler tools
    probably the problem is, that mycompiler doesn't suport automatic template instanciation. Something that I find verry anoing. What point does it have to use templates if you cant use them for a type without instancieting them first.

    Thank you for your help!

    regards
    Michael
    See more | Go to post

    Leave a comment:


  • nomad5000
    replied to How to use templates propperly
    in C
    this is verry nice and I already knew about it, but there has to be a way where you dont have to use this
    [HTML]
    template class Template<int>;// explicit instantiation of int version
    [/HTML]
    What I want to do is write a Class for example a Stack class that I can use with whatever type of data without having to explicitly instantiate.
    See more | Go to post

    Leave a comment:


  • nomad5000
    started a topic How to use templates propperly
    in C

    How to use templates propperly

    Helo I´m having trouble finding out how to use templates properly. Te problem I´m having is, that I can´t find the right way to make the templates work outside the file where the class using the template is declared. Look at the following example.

    Template.h file
    [PHP]
    #ifndef TEMPLATE_H
    #define TEMPLATE_H

    template<typena me T>
    class Template{
    private:
    T info;...
    See more | Go to post

  • nomad5000
    started a topic Problems with FileImageOutputStream
    in Java

    Problems with FileImageOutputStream

    Hi I'm trying to write to a text file with the class FileImageOutput Stream but I can't manage to overwrite the file I'm writing to. So I tried to flush the Object with the flush() method but it still doesn't work. Here is my code:
    Code:
    import java.io.File;
    import javax.imageio.stream.FileImageInputStream;
    import javax.imageio.stream.FileImageOutputStream;
    import java.io.FileNotFoundException;
    import java.io.IOException;
    ...
    See more | Go to post

  • nomad5000
    replied to problems with strtok()
    in C
    Thank you very much!

    What a stupid mistake.
    See more | Go to post

    Leave a comment:


  • nomad5000
    started a topic problems with strtok()
    in C

    problems with strtok()

    Hi everybody!

    I'm having trouble using strtok to fill a matrix with int nrs. from a file.
    the code that is not working is the following:
    Code:
    #include <iostream>
    #include <fstream>
    #include <string>
    #include <stdlib.h>
    using namespace std;
    void leerMatriz(char * archivo,int matriz[11][11]);
    void leerMatriz(char * archivo,int matriz[11][11]){
    ...
    See more | Go to post

  • nomad5000
    replied to problems with seekg
    in C
    Thank you very much!

    One more question. Is there some kind of refference where all thees tricks with files are explained?
    See more | Go to post

    Leave a comment:


  • nomad5000
    started a topic problems with seekg
    in C

    problems with seekg

    Hi I'm trying to read a textfile and print it's content twice to the std::cout but it won't work the second time. I think it has something to do with the seekg(0) command but I don't know.

    here is my code:
    the seekg.cpp file:
    Code:
    #include <iostream>
    #include <fstream>
    using namespace std;
    int main(){
    	ifstream in("data.txt",ios::in);
    	if(!in){
    		cerr<<"file
    ...
    See more | Go to post

  • nomad5000
    replied to problems with inheritance in g++ compiler
    in C
    thank you both very much. You where of great help.
    See more | Go to post

    Leave a comment:


  • nomad5000
    replied to problems with inheritance in g++ compiler
    in C
    I get the idea now, a virtual method in c++ is not the same as an abstract method in java. But isn't there a way to declare a class abstract, that is that there can be no instances of this class?
    See more | Go to post

    Leave a comment:


  • nomad5000
    started a topic problems with inheritance in g++ compiler
    in C

    problems with inheritance in g++ compiler

    I'm trying to compile the following code but it won't work.

    the compiler always tells me:

    michael@michael :~/forum$ g++ *.cpp
    ClassB.cpp: In member function `virtual void ClassB::abstrac tMethod(int) const
    ':
    ClassB.cpp:6: error: passing `const ClassB' as `this' argument of `void
    ClassA::setAttr ibute(int)' discards qualifiers
    michael@michael :~/forum$

    I've tried to...
    See more | Go to post

  • nomad5000
    replied to g++ compiling
    in C
    thank you very much!
    See more | Go to post

    Leave a comment:


  • nomad5000
    replied to Constructors and Destructors
    in C
    Basically Constructors are there to instantiate an object of a defined class. in your example the class is Cat. What this mean is, when your program calls Cat Frisky(5); in the main method, a new instance of Cat is created. How this is done is pretty simple , remember the
    Cat::Cat(int initialAge) part of your cpp file? This is the code that is executed when you tell the program to do Cat Frisky(5). Frisky is the name of the variable that...
    See more | Go to post

    Leave a comment:


  • nomad5000
    started a topic g++ compiling
    in C

    g++ compiling

    I can't compile this using g++
    michael@michael :~/g++$ g++ program.cpp
    //ClassA.h
    class ClassA{
    private:
    int atribute;
    public:
    ClassA(int atribute);
    };
    //ClassA.cpp
    #include "ClassA.h"

    ClassA::ClassA( int atribute){
    this->atribute = atribute;
    }
    //program.cpp
    #include "ClassA.h"
    #include <iostream>...
    See more | Go to post
No activity results to display
Show More
Working...