• Member Avatar for Ancient Dragon
    Ancient Dragon

    Replied To a Post in how to intial the array of structs from text filr

    this one works as expected. void sortstudents() { clearWindow(); FILE *fp; fp = fopen("record.txt", "r"); if (fp != NULL) { //stud *arr = (stud *)malloc(chunck); stud starray[25] = { 0 …
  • Member Avatar for Ancient Dragon
    Ancient Dragon

    Replied To a Post in how to intial the array of structs from text filr

    line 300: The file pointer is at EOF when that line is reached because of lines 277-288: there is no need for that loop so just delete it. Besides, there …
  • Member Avatar for Ancient Dragon
    Ancient Dragon

    Replied To a Post in File Streaming

    You'll get better answers if you post in the corrct forum instead of just posting in any random forum that suits your fancy. Would you go to a butcher to …
  • Member Avatar for Ancient Dragon
    Ancient Dragon

    Replied To a Post in simple linked list

    The while loop beginning on line 28 needs brackets { and } because there are more than one statement within the loop You don't need the if statement on line …
  • Member Avatar for Ancient Dragon
    Ancient Dragon

    Replied To a Post in how to intial the array of structs from text filr

    How did you write the records? Did you use fwrite()? If you did, then just use fread(). The parameters to fread() are the same as fwrite() struct student students[100]; int …
  • Member Avatar for Ancient Dragon
    Ancient Dragon

    Replied To a Post in how to intial the array of structs from text filr

    You need to post a couple lines from the file so we can see how it is formatted. But generally you would want to read each field into it's appropriate …
  • Member Avatar for Ancient Dragon
    Ancient Dragon

    Replied To a Post in File Streaming

    This is C# forum, not java. For java questions post in the java forum. And ... do not hijack someone else's thread to ask your question but start your own …
  • Member Avatar for Ancient Dragon
    Ancient Dragon

    Replied To a Post in File transfer via WiFi

    I have both windows 8.1 and windows 7 on the same homegroup network and they each share printers and folders with each other. Most are wired, but one is wifi.
  • Member Avatar for Ancient Dragon
    Ancient Dragon

    Replied To a Post in warning: cast from pointer to integer of different size

    Before comparing a pointer to NULL you have to initialize them to null when you declare the pointers (or at least some time before using them). If you don't then …
  • Member Avatar for Ancient Dragon
    Ancient Dragon

    Replied To a Post in artificial inteligence

    >Are we ever able to make a program that can speak like a human ? Just ask Lieutenant Commander Data from Star Trek or the darleks from Dr. Who :)
  • Member Avatar for Ancient Dragon
    Ancient Dragon

    Replied To a Post in simple while loop problem

    the value of SIzE is 4, the initial value of counter is 0. So SIZE never equals (counter+1). The value of counter never changes inside the loop. >how is the …
  • Member Avatar for Ancient Dragon
    Ancient Dragon

    Replied To a Post in c++ with sqlite3 insert function(not inserting values)

    It looks like main() is calling the wrong function. insertIntoTable() instead of insertValuel() IMO insertValue() is too complicated, paramitizing the sql like that is not necessary. sprintf(sql,"INSERT INTO table(id,text) VALUES(%d,\"%s\")",1,randomText.c_str()); …
  • Member Avatar for Ancient Dragon
    Ancient Dragon

    Replied To a Post in Clipboard Wait

    How do you think data is going to be put into the clipboard? Some process other than your program has to do it, it's not possible for someone enter clipboard …
  • Member Avatar for Ancient Dragon
    Ancient Dragon

    Replied To a Post in Sum of Corner elements in an 2D array

    Thanks for doing his homework for him.
  • Member Avatar for Ancient Dragon
    Ancient Dragon

    Replied To a Post in Clipboard Wait

    How do you expect the thread to wait until it does something? You can't have it both ways. What's supposed to happen when GetClipboardData() returns NULL? You need to put …
  • Member Avatar for Ancient Dragon
    Ancient Dragon

    Replied To a Post in error message when inputing in a array of struct

    >person.name[i] You need to index person, not name `person[i].name`
  • Member Avatar for Ancient Dragon
    Ancient Dragon

    Replied To a Post in Sum of Corner elements in an 2D array

    In a M by N array, where M is the number of rows and N is the number of columns, the array has these coordinates Upper left: 0,0 Lower left: …
  • Member Avatar for Ancient Dragon
    Ancient Dragon

    Replied To a Post in system() error

    line 11: remove all the spaces.
  • Member Avatar for Ancient Dragon
    Ancient Dragon

    Replied To a Post in C programming

    No, I will not solve it for you, but we will help you solve it yourself. Post some code that you have started so we can see where you need …
  • Member Avatar for Ancient Dragon
    Ancient Dragon

    Replied To a Post in Bad Grammar

    One would think that one would not want to sound pretentious, now would one? :)
  • Member Avatar for Ancient Dragon
    Ancient Dragon

    Replied To a Post in Classes and Threads

    yes. If you want it in another thread then you have to specifically create a new thread, then start a new instance of the class from within that new thread. …
  • Member Avatar for Ancient Dragon
    Ancient Dragon

    Replied To a Post in Database connectitvity

    Your options are somewhat limited, but [here ](http://www.easysoft.com/developer/languages/c/odbc_tutorial.html)is an ODBC tutorial
  • Member Avatar for Ancient Dragon
    Ancient Dragon

    Replied To a Post in Classes and Threads

    It runs in the curreent thread.
  • Member Avatar for Ancient Dragon
    Ancient Dragon

    Replied To a Post in Reading from txt file into linked list

    I did this and it still works ok char* result; while( (result = fgets(line, sizeof(line), fp)) != NULL) { puts(result); char* token = strtok(line, " ");
  • Member Avatar for Ancient Dragon
    Ancient Dragon

    Replied To a Post in C++ strings Arguments?

    You can usually find online help with most c++ functions and classes by googlein for them. In this case, google for "c++ std::string" and [this ](http://www.cplusplus.com/reference/string/string/)will be the first hit …
  • Member Avatar for Ancient Dragon
    Ancient Dragon

    Replied To a Post in malloc vs calloc

    calloc is the same as malloc but calloc initializes the memory to all 0s Both these are the same int *array = malloc(10 * sizeof(int)); for(int i = 0; i …
  • Member Avatar for Ancient Dragon
    Ancient Dragon

    Replied To a Post in Reading from txt file into linked list

    Nothing wrong with fgets() #include <stdio.h> #include <stdlib.h> #include <string.h> #pragma warning(disable: 4996) int main() { char line[126]; FILE* fp = fopen("TextFile.txt","r"); if (fp == NULL) { puts("Can't open the …
  • Member Avatar for Ancient Dragon
    Ancient Dragon

    Replied To a Post in Reading from txt file into linked list

    You must be doing something else wrong. This works ok for me #include <stdio.h> #include <stdlib.h> #include <string.h> #pragma warning(disable: 4996) int main() { char line [] = "Client: z …
  • Member Avatar for Ancient Dragon
    Ancient Dragon

    Replied To a Post in Reading from txt file into linked list

    post the line that was read from the file. If the program doesn't print "CLIENT" like you had on line 16 then my guess is the line in the file …
  • Member Avatar for Ancient Dragon
    Ancient Dragon

    Replied To a Post in Reading from txt file into linked list

    line 17 the first parameter to strtok() should be NULL, because it's alredy been called with line as the first parameter on line 12. if( strcmp(token,"Client:") == 0) { printf("CLIENT\n"); …
  • Member Avatar for Ancient Dragon
    Ancient Dragon

    Replied To a Post in Reading from txt file into linked list

    Yes, it works something like that. Example: char line[] = "one two three 123 456"; char* ptr = strtok(line," ") while( ptr != NULL) { puts(ptr); ptr = strtok(NULL," "); …
  • Member Avatar for Ancient Dragon
    Ancient Dragon

    Replied To a Post in Replace hex value from dat file in bin file

    Don't understand the problem. Do you just want to copy some bytes from the data file to a bin file? The terms "data file" and "bin file" are rather ambibuous, …
  • Member Avatar for Ancient Dragon
    Ancient Dragon

    Replied To a Post in Reading from txt file into linked list

    This is one way to do it. fgets(line,sizeof(line),fp); // get first token on the line char* token = strtok(line," "); if( strcmp(token,"Client:") == 0) { // process line as client …
  • Member Avatar for Ancient Dragon
    Ancient Dragon

    Replied To a Post in [Suggestion] Make the user info also as a static header

    Isn't that how it's supposed to work? When scrolling through a thread only the <DANIWEB> link and search bar are fixed. The other lines are also fixed when scrolling through …
  • Member Avatar for Ancient Dragon
    Ancient Dragon

    Replied To a Post in Segmentation Fault in mex file

    Line 23: what exactly does sizeof(buf) return? Answer: check line 10 and you will see buf is declared as 1024 pointers, so sizeof(buf) is 1024 \* sizeof(char\*). Assuming sizeof(char\*) == …
  • Member Avatar for Ancient Dragon
    Ancient Dragon

    Replied To a Post in data length of number types

    look in your compiler's limits.h header file. You will find them all there. >and anything bigger than that? That doesn't make any sense. What do you mean by "bigger than …
  • Member Avatar for Ancient Dragon
    Ancient Dragon

    Replied To a Post in Reading from txt file into linked list

    Read a line. If it starts with Client then you know you have to allocate a new client node. If it starts with Item then add a new Item node …
  • Member Avatar for Ancient Dragon
    Ancient Dragon

    Replied To a Post in Reading from txt file into linked list

    There are many ways to accomplish it. You could add a small item at the beginning of each line that identifies it as either client or item. fprintf(f,"Client: %s %s\n",head->client_name,head->client_last_name); …
  • Member Avatar for Ancient Dragon
    Ancient Dragon

    Replied To a Post in Problem with Files

    It doesn't work because it never saves the data to the file.
  • Member Avatar for Ancient Dragon
    Ancient Dragon

    Replied To a Post in Password Generator in C

    >but now when i generate a password it has weird characters in it Because there are unused bytes in the array that contain random junk characters. Initialize the whole array …
  • Member Avatar for Ancient Dragon
    Ancient Dragon

    Replied To a Post in artificial inteligence

    How many years did you say you have to write/test that program??
  • Member Avatar for Ancient Dragon
    Ancient Dragon

    Replied To a Post in problem creating a shared library and linking

    are you linking with both libraries?
  • Member Avatar for Ancient Dragon
    Ancient Dragon

    Replied To a Post in Is VB free or do I buy it?

    > apart from seeing technical words I do not understand, What didn't you understand?
  • Member Avatar for Ancient Dragon
    Ancient Dragon

    Replied To a Post in C programming

    Do you mean the sum of each column? You will need two loops to do that, the outer loops counts N columns and the inner loop counts M rows. It's …
  • Member Avatar for Ancient Dragon
    Ancient Dragon

    Replied To a Post in reading tab delimited file in C

    Oh, normally something that contains the dot is a file extension, such as .txt, .dat, .mex, etc. I thought you were walking about a file format. I never studied MATLAB …
  • Member Avatar for Ancient Dragon
    Ancient Dragon

    Replied To a Post in reading tab delimited file in C

    That doesn't explain what a .mex file is.
  • Member Avatar for Ancient Dragon
    Ancient Dragon

    Replied To a Post in reading tab delimited file in C

    >Can anyone help me converting it to a .mex file ? What is a .mex file???
  • Member Avatar for Ancient Dragon
    Ancient Dragon

    Replied To a Post in help with 3D array

    line 15 of the code you posted is wring.
  • Member Avatar for Ancient Dragon
    Ancient Dragon

    Replied To a Post in help with 3D array

    Other than poor formating, I don't see anything wrong with how you allocated the array. The values in the array are something else. void John_is_3D(int dimx, int dimy, int dimz) …
  • Member Avatar for Ancient Dragon
    Ancient Dragon

    Replied To a Post in Deleting node from nested list

    line 18: since the node is now deleted you might as well stop looking, unless there could be more nodes with the same name. lines 20 and 21 won't work …

The End.