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.
User Profile
Collapse
-
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. -
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...Leave a comment:
-
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...Leave a comment:
-
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.Leave a comment:
-
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....Leave a comment:
-
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.Leave a comment:
-
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.Leave a comment:
-
Yeah it compiles ok now but it's still getting stuck in my while loop!Leave a comment:
-
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.Leave a comment:
-
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();
I have #include <string.h>...Leave a comment:
-
Ok, I think I follow.
I'll have to go through it slowly.
ThanksLeave a comment:
-
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);
No activity results to display
Show More
Leave a comment: