User Profile

Collapse

Profile Sidebar

Collapse
meatstu
meatstu
Last Activity: Aug 19 '08, 11:02 AM
Joined: Feb 20 '07
Location:
  •  
  • Time
  • Show
  • Source
Clear All
new posts

  • meatstu
    replied to GUIs in C++
    in C
    Ok cheers guys I'll take a look.
    I run windows OS and would be looking at creating a suitable application.
    Thanks for the replies.
    Stu.
    See more | Go to post

    Leave a comment:


  • meatstu
    started a topic GUIs in C++
    in C

    GUIs in C++

    Can you create GUIs such as textboxes using C++?
    I have only written basic classes as a small part of my uni course but would like to do more.
    I dont actually have any reason to do this I was just wondering if it was possible and if so, what areas should I research?

    Regards
    Stu.
    See more | Go to post

  • I cant quite see what youre trying to do with your bit of code but if you want to find if a number is prime why dont you try something like this:

    1. Declare a variable, call it 'div' and initialise equall to 3.

    2. Get the user to type in a number to be checked.

    3. Divide that number by 2. If there is no remainder the number is not prime, Yes? If there is a remainder go to step 3.

    4. Divide...
    See more | Go to post

    Leave a comment:


  • meatstu
    replied to No of lies in a text file.
    in C
    Yes Adrian I do, I guess using the old standard was the root of my problems. I'm only doing simple programmes at the moment which is probably why I have not encountered any problems, I will take your advice, and thank you for the explanation.
    Stu...
    See more | Go to post

    Leave a comment:


  • meatstu
    replied to 3D arrays
    in C
    I am a student myself and the answer ganymede has posted is the way I have always done any initialising or deleting of arrays.
    I dont know of any other way.
    Stu.
    See more | Go to post

    Leave a comment:


  • meatstu
    replied to No of lies in a text file.
    in C
    Yes I am doing this later in the code, I just copied out what I thought was needed for my post, thanks tho.

    With regards to the .h issue, I also found that when I removed it I needed to specify a namespace.
    Stu....
    See more | Go to post

    Leave a comment:


  • meatstu
    replied to No of lies in a text file.
    in C
    Ah right thats the way I've done file read in the past, I was told to put the brackets there.
    It's not getting stuck in the loop now, I've changed 'cin' to 'file1'. However it now seems to be corrupting the data in the file.
    I will try and work throught his myself, but many thanks for your help, it's much appreciated.
    Stu.
    See more | Go to post

    Leave a comment:


  • meatstu
    replied to No of lies in a text file.
    in C
    I dont quite follow, if you mean why do I put my '{' under the line rather than than at the end of the file1.open line, this was the style I was first shown when I first started learning programming.
    See more | Go to post

    Leave a comment:


  • meatstu
    replied to No of lies in a text file.
    in C
    Yeah it compiles ok now but it's still getting stuck in my while loop!
    See more | Go to post

    Leave a comment:


  • meatstu
    replied to No of lies in a text file.
    in C
    It's C++, It's in a method within a class.
    I am using MS Visual C++ 6.0.
    This is all pretty new to me.
    See more | Go to post

    Leave a comment:


  • meatstu
    replied to No of lies in a text file.
    in C
    Sorry I am still having no luck, I have tried this:

    Code:
    filesize=0;
    fstream file1;					
    string s;
    file1.open("graph.txt",ios::in);
    {
    	while(!file1.eof())
    	{
    		getline(cin,s);
    		filesize++;
    	}
    		
    }
    file1.close();
    Is this wrong? I am getting undeclared identifier erros for s,string and getline.
    I have #include <string.h>...
    See more | Go to post

    Leave a comment:


  • meatstu
    replied to No of lies in a text file.
    in C
    Ok, I think I follow.
    I'll have to go through it slowly.
    Thanks
    See more | Go to post

    Leave a comment:


  • meatstu
    started a topic No of lies in a text file.
    in C

    No of lies in a text file.

    Hello everyone I was hoping someone could point me in the right direction with a problem I have reading from a text file.
    I am trying to find out how many lines of data are in a text file,the file will contain a list of names in this sort of format:
    john
    dave
    bob
    etc.
    I have written the following code so far:

    Code:
    filesize=0;
    fstream file1;					
    file1.open("graph.txt",ios::in);
    ...
    See more | Go to post
No activity results to display
Show More
Working...