Search:

Type: Posts; User: Bakster

Search: Search took 0.01 seconds.

  1. Replies
    2
    Views
    1,017

    That's great. I've located the appropriate...

    That's great. I've located the appropriate directory, and now my file operation works. Thanks a lot!
  2. Replies
    2
    Views
    1,017

    Silly Visual C++ Problem

    Hello, I recently got Visual C++ and I am having a problem with it. I have a text file I want to input into my program but I don't know the directory Visual C++ reads files from or how to find out....
  3. Replies
    17
    Views
    4,569

    OK, it works fine now, thanks a lot!

    OK, it works fine now, thanks a lot!
  4. Replies
    17
    Views
    4,569

    Here is my latest version: #include...

    Here is my latest version:


    #include "stdio.h"
    #include "conio.h"
    #include "string.h"

    void enter(char lib[100][3][50]);
    void findAuthor(char lib[100][3][50]);
    void findTitle(char...
  5. Replies
    17
    Views
    4,569

    Well I don't really know any alternatives to read...

    Well I don't really know any alternatives to read a character. The only other input function I am aware of is scanf.
  6. Replies
    17
    Views
    4,569

    Alright I went back to fgets() again, it seems to...

    Alright I went back to fgets() again, it seems to be in working order except for the getchar() problem, I still don't know where to place the while loop fragment.
  7. Replies
    17
    Views
    4,569

    I replaced the gets() with scanf and this is my...

    I replaced the gets() with scanf and this is my new program:


    #include "stdio.h"
    #include "conio.h"
    #include "string.h"

    void enter(char lib[100][3][50]);
    void findAuthor(char...
  8. Replies
    17
    Views
    4,569

    Thanks for all that information, dwks. My program...

    Thanks for all that information, dwks. My program now acts better than it did previously, but the program just prints all the options ("Enter the title: " etc.) after I select a menu choice without...
  9. Replies
    17
    Views
    4,569

    I rewrote the program: #include "stdio.h"...

    I rewrote the program:


    #include "stdio.h"
    #include "conio.h"
    #include "string.h"

    void enter(char c1[100][3][50]);
    void findAuthor(char c2[100][3][50]);
    void findTitle(char c3[100][3][50]);
  10. Replies
    17
    Views
    4,569

    I didn't think you could pass an array into a...

    I didn't think you could pass an array into a function, only a pointer. I previously tried indexing the pointer passed into the function like I would index an array, but that didn't compile either.
  11. Replies
    17
    Views
    4,569

    Simple Library Catalog Program not working

    I have written what is my largest program to date, a simple library catalog:


    #include "stdio.h"
    #include "conio.h"
    #include "string.h"

    void enter(char *c1);
    void findAuthor(char *c2);...
  12. Thread: Pointers Issue

    by Bakster
    Replies
    9
    Views
    1,117

    Thanks Drogin, but I have corrected my code and...

    Thanks Drogin, but I have corrected my code and it now works as it should:


    #include "stdio.h"
    #include "string.h"

    void mystrcat(char *first, char *second);

    int main(void)
    {
  13. Thread: Pointers Issue

    by Bakster
    Replies
    9
    Views
    1,117

    I thought you could use the name of an array...

    I thought you could use the name of an array without the index just like an ordinary pointer, but evidently this is not the case. I created another pointer like this


    char *p;
    p = result;

    and...
  14. Thread: Pointers Issue

    by Bakster
    Replies
    9
    Views
    1,117

    Thanks, I made those edits to my code but I get...

    Thanks, I made those edits to my code but I get exactly the same error when I try to compile it.
  15. Thread: Pointers Issue

    by Bakster
    Replies
    9
    Views
    1,117

    Pointers Issue

    Hello, I am attempting to write a program in which I write my own version of the library function 'strcat' using pointers:


    #include "stdio.h"
    #include "string.h"

    void mystrcat(char *first,...
  16. Replies
    15
    Views
    16,902

    It works now, thanks a lot :)

    It works now, thanks a lot :)
  17. Replies
    15
    Views
    16,902

    I tried: __int64 f = 600851475143; I get...

    I tried:


    __int64 f = 600851475143;

    I get a compiler error saying 'integer constant is too large for "long" type'. Same for long long int.

    I'm using Dev-C++, I assume that int64 and long...
  18. Replies
    15
    Views
    16,902

    Calculating prime factor of a huge number.

    I've succesfully written some code that prints out the prime factors of integers. It works succesfully for small-ish integers, but my task is to calculate the largest prime factors of 600851475143....
  19. Replies
    11
    Views
    1,886

    Yes I noticed that when I added the printf...

    Yes I noticed that when I added the printf function MK27 posted, and edited my if condition:

    if (current%2==0 && current < 4000000)



    Didn't spot it by myself, hence the thread, but...
  20. Replies
    11
    Views
    1,886

    Ah yes, I see the problem now. Removing the '+'...

    Ah yes, I see the problem now. Removing the '+' from '+=' on line 10 fixed it. Thanks a lot! :D
  21. Replies
    11
    Views
    1,886

    Yeah that would have been the smart thing to do....

    Yeah that would have been the smart thing to do. I'll get to work trying to fix it. Thanks!
  22. Replies
    11
    Views
    1,886

    Simple program not working, don't know why

    Hello everybody, I'm pretty much a beginner at using C, so my problem shouldn't be too difficult for you to solve, I hope. I wrote this program to sum all the even numbers in the fibonacci sequence...
Results 1 to 22 of 22