User Profile

Collapse

Profile Sidebar

Collapse
niskin
niskin
Last Activity: Jul 17 '07, 12:41 PM
Joined: Apr 17 '07
Location:
  •  
  • Time
  • Show
  • Source
Clear All
new posts

  • niskin
    replied to Open file fopen() and print values
    in C
    got it in 1, my friend
    See more | Go to post

    Leave a comment:


  • niskin
    replied to Open file fopen() and print values
    in C
    lol how did u know it was a? =O
    See more | Go to post

    Leave a comment:


  • niskin
    replied to system() in for loop
    in C
    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
    ...
    See more | Go to post

    Leave a comment:


  • niskin
    replied to Regarding Text files
    in C
    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);
    See more | Go to post

    Leave a comment:


  • niskin
    replied to system() in for loop
    in C
    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];
    ...
    See more | Go to post

    Leave a comment:


  • niskin
    replied to Open file fopen() and print values
    in C
    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 ()
    ...
    See more | Go to post

    Leave a comment:


  • niskin
    replied to system() in for loop
    in C
    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:
    ...
    See more | Go to post

    Leave a comment:


  • niskin
    replied to Open file fopen() and print values
    in C
    [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
    }
    [QUOTE]

    You are treating line as if it is an array. Instead of:
    Code:
    string line;
    Put:

    Code:
    char line[20]; //20 is just an example, you can have it
    ...
    See more | Go to post

    Leave a comment:


  • niskin
    replied to Open file fopen() and print values
    in C
    You can open a file like this:

    Code:
    FILE *fp;
    fp=fopen("example.txt", "r");
    Then you can read the contents into variables using fscanf. Look up how to use fscanf because I don't want to give you all the source code as you won't learn that way. You need to look up file i/o as well. Here is a link to a useful site:

    www.cprogrammin g.com
    See more | Go to post

    Leave a comment:


  • niskin
    replied to system() in for loop
    in C
    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() {
    ...
    See more | Go to post

    Leave a comment:


  • niskin
    replied to system() in for loop
    in C
    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];
    ...
    See more | Go to post

    Leave a comment:


  • niskin
    replied to html textbox default position
    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?...
    See more | Go to post

    Leave a comment:


  • niskin
    replied to system() in for loop
    in C
    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.
    See more | Go to post

    Leave a comment:


  • niskin
    replied to starting processes using wmic
    I learnt more by finding out myself in the end so it's all good.
    See more | Go to post

    Leave a comment:


  • niskin
    replied to system() in for loop
    in C
    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;
    ...
    See more | Go to post

    Leave a comment:


  • niskin
    replied to system() in for loop
    in C
    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),
    ...
    See more | Go to post

    Leave a comment:


  • niskin
    replied to Move Window w/Mouse
    in C
    Well done, it's always great to figure out things ourselves, for both the learning experience and the sense of achievement.
    See more | Go to post

    Leave a comment:


  • niskin
    replied to starting processes using wmic
    Don't worry I found out how from microsoft.com.
    See more | Go to post

    Leave a comment:


  • niskin
    replied to system() in for loop
    in C
    Have you got any websites you can point me to that will teach me how to do this?
    See more | Go to post

    Leave a comment:


  • niskin
    replied to How to start leaning C language?
    in C
    Cprogramming.co m and Cplusplus.com
    See more | Go to post

    Leave a comment:

No activity results to display
Show More
Working...