User Profile

Collapse

Profile Sidebar

Collapse
lolcheelol
lolcheelol
Last Activity: Oct 7 '10, 02:10 AM
Joined: Feb 12 '10
Location:
  •  
  • Time
  • Show
  • Source
Clear All
new posts

  • lolcheelol
    replied to Linked lists and inserting nodes (c++)
    in C
    i figured it out, i didn't need nodetype *c because it would be adding node.
    See more | Go to post

    Leave a comment:


  • lolcheelol
    started a topic Linked lists and inserting nodes (c++)
    in C

    Linked lists and inserting nodes (c++)

    the program runs without errors, but when i try to use the changenode function, if i put anything above 2 it doesn't change the correct node. here is the source code.

    Code:
    #include <iostream.h>
    #include <fstream.h>
    #include <stdio.h>
    #include <stdlib.h>
    #include <conio.h>
    #include <string.h>
    
    
    typedef
    struct node{
        int data1;
    ...
    See more | Go to post

  • lolcheelol
    started a topic c++ calling link lists in main..serious help :/
    in C

    c++ calling link lists in main..serious help :/

    i understand the concept of linked lists and how they work, but i cannot seem to grasp how to convert random numbers in the main to. if anyone can help fix my code up that would be really helpful.

    Code:
    #include <iostream.h>
    #include <fstream.h>
    #include <stdio.h>
    #include <stdlib.h>
    #include <conio.h>
    #include <string.h>
    
    
    typedef struct linknode{
    ...
    See more | Go to post

  • linked list...no error, but not the right information

    here is the entire source code. there are no errors, but what it is outputting is not what i want.

    Code:
    #include <iostream.h>
    #include <fstream.h>
    #include <stdio.h>
    #include <stdlib.h>
    #include <conio.h>
    #include <string.h>
    
    
    typedef struct linknode{
    	int data1;
    	char data2;
    	linknode *p;
    } nodetype;
    
    int
    ...
    See more | Go to post

  • lolcheelol
    replied to C++ Polymorphism conversion error
    in C
    I figured it out. Thanks for your help :]
    See more | Go to post

    Leave a comment:


  • lolcheelol
    started a topic C++ Polymorphism conversion error
    in C

    C++ Polymorphism conversion error

    The error I am getting is:

    ERROR E2034 Cannot Convert 'Data 3 *' to 'Gg *' in function main()

    This is my source code, well the stuff that matters I believe. The code is about 500 lines, and I didn't want to flood it, so yeah here you go.

    Code:
    class Data3: public Data2a, public Data2b{
    protected: 
    int *p2;
    int *p3;
    int ct1;
    int forever1;
    public:
    Data3();
    ~Data3();
    ...
    See more | Go to post

  • lolcheelol
    replied to C++ Class Function/Method Friends?
    in C
    yeah im still getting that one same error...
    See more | Go to post

    Leave a comment:


  • lolcheelol
    replied to C++ Class Function/Method Friends?
    in C
    if i do that, then class 3 wouldn't be recognized in the Host3 class.
    See more | Go to post

    Leave a comment:


  • lolcheelol
    started a topic C++ Class Function/Method Friends?
    in C

    C++ Class Function/Method Friends?

    i'm trying to use the method friends in this class 3...here is the error im getting.

    Error 2316 112: 'Host3::seeData (Class3)' is not a member of 'Host3'

    Code:
    class Host3;
    class Class3: public Class2{
    protected:
    int *p5;
    public:
    Class3();
    ~Class3();
    void inputData();
    void showData();
    friend int Host3::seeData(Class3 ); -----------$$$$$$$$$$$$-------LINE 112~~~~~
    ...
    See more | Go to post

  • lolcheelol
    replied to Overloading classes problem...
    in C
    okay thanks for your help!
    See more | Go to post

    Leave a comment:


  • lolcheelol
    replied to Overloading classes problem...
    in C
    correct, when I do that it crashes after printing the 100 random numbers.
    See more | Go to post

    Leave a comment:


  • lolcheelol
    replied to Overloading classes problem...
    in C
    if i'm understanding you correctly, i would just change


    Code:
    Data1::Data1(){
     p1 = new int[1300];
     size1 = 1300;
    }
    to

    Code:
    Data1::Data1(){
     p1 = new int[100];
     size1 = 100;
    }
    See more | Go to post

    Leave a comment:


  • lolcheelol
    started a topic Overloading classes problem...
    in C

    Overloading classes problem...

    I'm trying to run this program and it works, but I would like to clean it up and make it more acceptable. One of the problems I am having is that when the program runs when I put p1 to 100 to print the random numbers it will print them, but then the program crashes. When I put p1 = 1300, it runs because that is the number of actual integers in the file I'm reading from. Here is the source code.

    Code:
    class Data1{
    protected:
    ...
    See more | Go to post

  • lolcheelol
    replied to Reading integers from a file into classes.
    in C
    okay great. thanks for your help. if i'm trying to read multiple files from a text file, how would it look like. this is what i have so far.

    Code:
    typedef struct record1{
       int n1;
       string name1;
       char c1;
       double d1;
    } set1;
    
    class Class1{
       private:
        int ct;
        set1 *s1;
       public:
        void rarray();
        void parray();   
    };
    ...
    See more | Go to post

    Leave a comment:


  • lolcheelol
    replied to Reading integers from a file into classes.
    in C
    Code:
    class Class1{
    private:
    int ct;
    int *p;
    int forever;
    public:
    void parray();
    void rarray();
    
    };
    
    void Class1::rarray(){
    ifstream in1("nums.dat");
    ct=0;
    p=new int[1300];
    forever=1;
    while(forever){
    in1 >> *(p+ct);
    
    if(*(p+ct) == -1) break;
    ct++;
    } // WHILE LOOP
    }
    
    void
    ...
    See more | Go to post

    Leave a comment:


  • lolcheelol
    replied to Reading integers from a file into classes.
    in C
    well that is the main() and all the codes really. all there really else is the cout << part. so do you think you can help me adjust these into a class?
    See more | Go to post

    Leave a comment:


  • lolcheelol
    started a topic Reading integers from a file into classes.
    in C

    Reading integers from a file into classes.

    I'm fairly new to classes and I know how to read integers from a file into the main, but I'm really getting confused on how to do it in classes.

    for example...

    Code:
    ifstream in1("nums.dat");
        int ct=0;
        int *p=new int[1300];
        int forever=1;
    
       while(forever){      
        in1 >> *(p+ct); 
        
       if(*(p+ct) == -1) break;
        ct++;
    ...
    See more | Go to post

  • lolcheelol
    started a topic How do you input size into a Class Function?
    in C

    How do you input size into a Class Function?

    Code:
    class Class1{
    private:
    int size;
    int x1[40];
    
    public:
    void sayit(int size);
    void sayit(int size);
    void doit();
    void writeit(); 
    }; // cs1
    
    void Class1::sayit(int size){
    cout <<"\n\n\t Random Numbers\n\n";
    }//sayit
    
    void Class1::sayit(int size){
    cout <<"\n\n\t Random Numbers\n\n";
    }//sayit
    ...
    See more | Go to post

  • lolcheelol
    replied to How to sort structure arrays
    in C
    i just commented out the entire block of string code. when i comment out the block it compiles fine, but it does not sort.
    See more | Go to post

    Leave a comment:


  • lolcheelol
    started a topic How to sort structure arrays
    in C

    How to sort structure arrays

    Code:
    typedef struct record1{
    int n1;
    string name1;
    char c1;
    double d1;
    } set1;
    
    int swap2(int &n1, int &n2){
    int temp;
    temp=n1;
    n1=n2;
    n2=temp;
    
    return 1; } // SWAP 2 NUM
    
    int swap2(char &n1, char &n2){
    char temp;
    temp = n1;
    n1 = n2;
    n1 = temp;
    
    return 1; } // SWAP 2 CHAR
    
    int
    ...
    See more | Go to post
No activity results to display
Show More
Working...