Search:

Type: Posts; User: slowprogrammer

Search: Search took 0.01 seconds.

  1. Replies
    6
    Views
    991

    cheers mate....

    cheers mate....
  2. Replies
    6
    Views
    991

    here's how i declared text: char...

    here's how i declared text:


    char text[LENGTH][SIZE];
    //This is done in the main function...


    Text is basically and array where i copy the file i open into...
  3. Replies
    6
    Views
    991

    well the compiler says: In function 'main'...

    well the compiler says:


    In function 'main'
    error: passing argument 2 of 'READ_FILE' from incompatible pointer type
    In function "READ_FILE":
    error: control reached end of non-void function
    ...
  4. Replies
    6
    Views
    991

    Function to open file

    Hey i am trying to make a function to open the file but am having trouble. The original code looks lie:


    fp=fopen(argv[1], "r");

    if(text==NULL) {

    EMPTY_FILE(1);

    ...
  5. um im not really sure what a regex engine is.......

    um im not really sure what a regex engine is....
    BUT what i have done is separate the command "search M.orning" into two string. If the first string is equal to "search" it starts to look for a...
  6. Search WILDCARD characer in STRING!!!!

    In my program i have a 2D array of strings and i want to implement a search function that can handle wildcard characters...
    For example the array has:
    Hello
    Good Morning
    Hello
    Good Evening
    ...
  7. wow i never imagined that my post would get so...

    wow i never imagined that my post would get so much interest...
  8. Replies
    2
    Views
    1,041

    Another short strcpy question

    If i had a string:
    search apple

    and i wanted to copy just "apple" into another string, i would be using the strcpy function but for some reason the code i am using doesn't compile properly...
  9. Replies
    2
    Views
    990

    ohhhhh of course.....I can't believe i didn't...

    ohhhhh of course.....I can't believe i didn't think of that.
    Thanks a lot though


    i guess i am living up to my username...
  10. Replies
    2
    Views
    990

    Quick strstr question!!!

    I have been using strstr to find a string within a string but there are some small questions that i wanted to clear up...
    In this code:


    char string1[]="red dwarf in the string";
    char...
  11. Replies
    5
    Views
    1,315

    ok so what you are suggesting is that when search...

    ok so what you are suggesting is that when search is typed in, the program initializes another array called search...
    then it scans in the input presented by the user into this array...

    Um i...
  12. Replies
    5
    Views
    1,315

    String Search

    Hey i have a program that reads the contents of a file into an array...now i want to extend this program so that when i type in search "word" it prints out the line in the text that has the "word in...
  13. Why do people have to assume that any question...

    Why do people have to assume that any question that is posted up is related to an assignment????
    Im currently doing a duke of ed course and one aspect of it requires that i need to learn a new skill...
  14. Interesting problem....reverse order of characters in a String!!!!

    Hey guys Im slowly starting to learn C and i was quite interested in this problem...
    If i entered a line of characters say a sentence how would i be able to print out the reverse of the input. Eg...
  15. Replies
    4
    Views
    2,796

    i sort of did figure it out..... what i didn't...

    i sort of did figure it out.....
    what i didn't tell you is that this program has a max elements of [1000][5] and the input to this program might be 10 lines or 50 or 100 so i have that counter that...
  16. Replies
    4
    Views
    2,796

    Is this BUBBLE SORT correct????

    Hey im wondering what is wrong with this bubble sort code:


    while (swapped){
    swapped=0;
    for(i=0; i<unsrtlen-1;i=i+1) {
    if (array[i+1][4]<array[i][4])...
  17. Replies
    11
    Views
    947

    oh right....i think i fixed it up...Here's what...

    oh right....i think i fixed it up...Here's what my code looks like now


    #include <stdio.h>
    int main (int argc, char *argv[])
    {

    int array[10000][5];
    int i=0;
    int j=0;
  18. Replies
    11
    Views
    947

    ummm i tried implementing that into my code and...

    ummm i tried implementing that into my code and it complied fine however now my results are really messed up....
    I made my array size [50][5] and then entered scanned in a file with 10 lines of test...
  19. Replies
    11
    Views
    947

    Ok so according to the man scanf the value of EOF...

    Ok so according to the man scanf the value of EOF (which is -1 right???) will be returned when input is stopped prior to what the maximum is....so if i place an EOF code line (which i do not know how...
  20. Replies
    11
    Views
    947

    OK so this is what i have understood so far: ...

    OK so this is what i have understood so far:
    the counter increments each time it reads one line of input...But why is it placed inside the first loop and not the nestled loop....(i might get it...
  21. Replies
    11
    Views
    947

    The input is going to be given like...

    The input is going to be given like (./programname<inputfile)...
    What i am not understanding is how EOF is coded....all the examples i have seen with EOF include components of C that i have not yet...
  22. Replies
    11
    Views
    947

    Ummmm i did read the FAQ it but I was not able to...

    Ummmm i did read the FAQ it but I was not able to understand it fully...Ive only been doing C for a few weeks and some of the stuff in it was something i have not covered before...
    From what i have...
  23. Replies
    11
    Views
    947

    Help With EOF in 2DARRAYS!!!!

    Hey guys I need to write a program that reads in an input using 2Darrays and then format the input in a table......
    I have been told that the maximum number of inputs will be 1000 lines....
    So the...
Results 1 to 23 of 23