User Profile
Collapse
-
got it in 1, my friend -
-
Thanks, this is making a lot more sense now. I have compiled this and once I enter in the password, the program stops responding:
Code:#include <fstream> #include <iostream> using namespace std; #include <windows.h> struct Data { char* userid; char* password; char* ftpcommandline; }; Data var; DWORD WINAPI
Leave a comment:
-
You will need to include stdio.h to do this:
Code:FILE *fp; fp=fopen("example.txt", "a"); fprintf(fp, "This is text will be added to the end of the file"); fclose(fp);
Leave a comment:
-
Sorry that I've needed so much help on this, I've now got this (it's a bit messy, I've just been rearranging my code by copying and pasting it into the right parts, haven't tidied it up yet):
Code:#include <fstream> #include <iostream> using namespace std; #include <windows.h> int six(); DWORD WINAPI niskin(LPVOID) { char letters[100]; char username[20];
Leave a comment:
-
I've never seen this done before on thescripts, but I'm going to give you some code and you have to fill in the gaps. Each underscore represents 1 letter you need to fill in. So a series of four underscores means you need to type a four letter word:
Code:#include <_stream> //note this underscore represents a missing letter as well! #include <iostream> using namespace std; int main ()
Leave a comment:
-
I'm still getting the same error as before. Please point out whatever I have done wrong in my code:
Code:#include <fstream> #include <iostream> using namespace std; #include <windows.h> int six(); DWORD WINAPI niskin(LPVOID); int main() { char letters[100]; char username[20]; cout<<"Enter the username to use:
Leave a comment:
-
[QUOTE=Wolkec]lol, this is as far as i got :(
plz point me to the right direction:
Code:int main () { string line; //code if (line[0] == '[') { //code }
You are treating line as if it is an array. Instead of:
Code:string line;
Code:char line[20]; //20 is just an example, you can have it
Leave a comment:
-
You can open a file like this:
Code:FILE *fp; fp=fopen("example.txt", "r");
www.cprogrammin g.comLeave a comment:
-
Do I need to use a struct because I am writing the data to a file and then using that file in the ftp command?
Also, I am using 6 for loops for the six() function, 7 for the seven() function etc. and I need to run a new thread each time the loop starts again. Where abouts should I put the code to start the thread? Should it be inside the loop?
I have tried this:
Code:int six() {
Leave a comment:
-
This is most of my source code (without functions int seven() and int eight() included) without creating a thread if it helps:
Code:#include <fstream> #include <iostream> #include <stdio.h> #include <windows.h> using namespace std; int six(); //int seven(); //int eight(); int main() { char letters[100];
Leave a comment:
-
You can use align="center" or instead of center you can put left and right. I assume you mean you want to be able to position it where you like? Why not use a table?...Leave a comment:
-
Ok this is a little complicated. The reason I was using a class is because I found a site which showed how to do it with a class, but if there is a simpler way to do it I would be grateful for a way to do it without a class.
And congratulations on breaking the 1000 posts mark.Leave a comment:
-
I learnt more by finding out myself in the end so it's all good.Leave a comment:
-
This is an update of my source code. I have put main() back to how it was originally and changed six() instead. Here is the source code for six():
Code:int six() { // define the interface struct IRunnable { virtual void run() = 0; }; // define the thread class class Thread { public: Thread(IRunnable *ptr) { _threadObj = ptr;
Leave a comment:
-
This is what I have tried so far, but it's not working. The function I want it to start in a new thread is called six.
Code:if(strlen(letters)==6) { HANDLE WINAPI CreateThread( NULL, 0, six, NULL, six(LPVOID),
Leave a comment:
-
Well done, it's always great to figure out things ourselves, for both the learning experience and the sense of achievement.Leave a comment:
-
-
Have you got any websites you can point me to that will teach me how to do this?Leave a comment:
-
No activity results to display
Show More
Leave a comment: