Search:

Type: Posts; User: scrfix

Page 1 of 2 1 2

Search: Search took 0.01 seconds.

  1. Replies
    34
    Views
    5,973

    Some of that is a little over my head but I will...

    Some of that is a little over my head but I will study the code and then try to implement it in my code. Thanks. I will try to get back to you with what my results are but that probably won't be...
  2. Replies
    34
    Views
    5,973

    So what you are telling me is that fgets is not...

    So what you are telling me is that fgets is not the correct function to use here because people can obviously type more than what fgets expects and it doesn't just drop the excess text. I was told...
  3. Replies
    34
    Views
    5,973

    I have not tried compiling it with another OS...

    I have not tried compiling it with another OS other than GCC in the Linux environment. I kind of wanted to get it working first in the linux environment prior to compiling it in another environment.
  4. Replies
    34
    Views
    5,973

    Okay, I will try that right now. Although I...

    Okay,

    I will try that right now. Although I am not really sure how to implement that so I will have to figure out what this actually means. It looks like it has EOF which I understand to be End...
  5. Replies
    34
    Views
    5,973

    I have read 12.26a and already tried...

    I have read 12.26a and already tried fflush(stdout) without success.
    I had not read 12.26b and that was pretty interesting to know. Is that trying to tell me that there is nothing standardized that...
  6. Replies
    34
    Views
    5,973

    The title might be off because as a beginner that...

    The title might be off because as a beginner that is what it appeared to me was happening. However the issue that is happening is still present.



    I changed the malloc back to MAXNAME and that...
  7. Replies
    34
    Views
    5,973

    I originally had the MAXNAME in my code for the...

    I originally had the MAXNAME in my code for the storage container however I through that perhaps since I was sending the stuff to a struct I need to allocate enough memory to store everything in the...
  8. Replies
    34
    Views
    5,973

    When I do that I get the following errors: ...

    When I do that I get the following errors:

    jharvard@appliance (~/Desktop/CS50/source code files): make ptr-strct
    gcc -ggdb -std=c99 -Wall -Werror ptr-strct.c -lcrypt -lcs50 -lm -o ptr-strct...
  9. Replies
    34
    Views
    5,973

    I used to have that in there but I received the...

    I used to have that in there but I received the following errors which is why I had to go to the strcpy function.

    ptr-strct.c:75:22: error: request for member 'fname' in something not a structure...
  10. Replies
    34
    Views
    5,973

    I have tried this is multiple places. In the...

    I have tried this is multiple places. In the struct I tried fname[MAXNAME+1]. This did not work. I tried in in the fgets function: fgets(storage,MAXNAME+1,stdin); and that didn't work.
    ...
  11. Replies
    34
    Views
    5,973

    It doesn't work. Here is what I did. I updated...

    It doesn't work. Here is what I did.
    I updated the MAXNAME macro from 20 to 21.

    I changed the removenewline function from changing the '\n' to 0 to change it to '\0'. This will ensure that...
  12. Replies
    34
    Views
    5,973

    It is automatically placed in there when I use...

    It is automatically placed in there when I use fgets. I shouldn't need to add it. Is that not correct? I have actually also tried to update the removenew line to replace the \n with '\0' instead...
  13. Replies
    34
    Views
    5,973

    fgets not truncating text

    Hello,

    My program actually works but has bugs in it and I don't know why the bugs are showing up.

    Background
    I am teaching myself how to program in C. I have been studying this for a while in...
  14. Replies
    7
    Views
    8,645

    You are exactly correct on two counts. I did...

    You are exactly correct on two counts. I did forget to update the prototype. I had never seen that error before. My swap also did not work. I don't know what you mean by dereference. Any...
  15. Replies
    7
    Views
    8,645

    It gives me the errors when I just do that. I...

    It gives me the errors when I just do that. I have tried the following:

    gcc -ggdb -std=c99 -Wall -Werror -o fifteen fifteen.c -lcs50 -lm
    fifteen.c: In function 'init':
    fifteen.c:152:9: error:...
  16. Replies
    7
    Views
    8,645

    I have tried them however I only have a basic...

    I have tried them however I only have a basic conception of pointers and was not able to get it to work. It kept telling me that I could send an integer argument without casting it as a pointer.

    ...
  17. Replies
    7
    Views
    8,645

    swapping function 2 dimensional arrays

    Hello,

    I am working on a swap function with 2 dimensional arrays. I have it working if I write it as an If statement but cannot get it to work as a function.

    It should basically initialize the...
  18. Replies
    12
    Views
    4,612

    This guy states he has been programming for...

    This guy states he has been programming for either 10 or 18 years in his introduction videos. They are not the best videos but they are at such a beginner level that I have to make it harder myself...
  19. Replies
    12
    Views
    4,612

    I would agree if that were my sole source for...

    I would agree if that were my sole source for learning. I am taking the Open Course Ware by Harvard for CS50 and Mobile phone programming. However in their video lectures they didn't explain items...
  20. Replies
    12
    Views
    4,612

    I do realize that those two lines of code are...

    I do realize that those two lines of code are C++. I was just beginning video tutorials. In the video tutorials, the guy teaches you using dev c++ and has you save your .c files as .cpp files. It...
  21. Thank you very much for that insight. I read the...

    Thank you very much for that insight.
    I read the Bridge Out Ahead in your signature and laughed... lol
    I have taken both of your suggestions in to account and added more on to the program.

    Thank...
  22. Here is the revised code. This was merely for a...

    Here is the revised code. This was merely for a project that I was working on for some video tutorials. The tutorials are stupidly easy so I am attempting to make them a little harder by added my...
  23. I understand that numOfStudents could be a char...

    I understand that numOfStudents could be a char over an int.
    If I knew what the error meant I would listen to it however I have never seen that error before. Line 30 is the scanf("....

    Just...
  24. Storing information in Arrays: Crash in Windows or Error in Linux

    I have an error happening here.
    1. I have attempted to write this function while I am learning C. It asks how many students and then asks for the age of each student.

    2. In Windows after 4 ages...
  25. Replies
    12
    Views
    4,612

    okay, I rewrote it to: #include ...

    okay, I rewrote it to:



    #include <conio.h>
    #include <iostream>
    #include <ctype.h>

    using namespace std;
Results 1 to 25 of 35
Page 1 of 2 1 2