Search:

Type: Posts; User: TieFighter

Page 1 of 2 1 2

Search: Search took 0.01 seconds.

  1. Replies
    3
    Views
    942

    No, I wasn't appending to the string twice. ...

    No, I wasn't appending to the string twice. Anyway - ended up figuring out that myOutput had too much memory allocated to it - just had to use a reduced size char*.

    Sometimes I feel like C is a...
  2. Replies
    3
    Views
    942

    strcat not functioning?

    I do have <string.h> included. I'm really not seeing why there's a segmentation fault when I try to concatenate these two strings together. Any help would be greatly appreciated. In the end this...
  3. Replies
    5
    Views
    2,026

    well, according to the man entry it should work...

    well, according to the man entry it should work with



    this format
  4. Replies
    5
    Views
    2,026

    Pesky Compiler Warnings

    My code works for one of my school projects, but there are still compiler warnings. May someone please help me figure out how to clean these up? The following are the code parts that are giving the...
  5. Replies
    11
    Views
    1,986

    Okay... you just defined how pass by reference is...

    Okay... you just defined how pass by reference is implemented. If any professor calls that pass by value, then I'd ask for some of my class money back.
  6. Replies
    11
    Views
    1,986

    No, I definitely meant method. This question...

    No, I definitely meant method. This question isn't necessarily about C.
    In C you can pass by reference (int &a) rather than (int a). Even in Java you may pass by reference provided your parameter...
  7. Replies
    11
    Views
    1,986

    My bad - I meant method instead of array. I also...

    My bad - I meant method instead of array. I also don't think you meant to imply all parameters are passed by value.
  8. Replies
    11
    Views
    1,986

    pass by reference is when the parameter...

    pass by reference is when the parameter references the original value passed into the method (by using the memory location's address)
    pass by value is when a copy of the value is given to the method...
  9. Replies
    6
    Views
    1,172

    try putting break; after each case.

    try putting break; after each case.
  10. Replies
    29
    Views
    6,966

    strings is changed to string - works perfectly,...

    strings is changed to string - works perfectly, thank you.
    well, yeah it should never be reached, but if it ever is - then you know the name probably wasn't entered.
  11. Replies
    29
    Views
    6,966

    Well, here's the end result - after making a...

    Well, here's the end result - after making a "removeName" function to compliment the "enterName" one. Can anyone get this to compile on their machine without warnings?



    /**********
    * Author:...
  12. Replies
    29
    Views
    6,966

    Yes, and strings.h

    Yes, and strings.h
  13. Replies
    29
    Views
    6,966

    Wait, I think I got it now - should have used...

    Wait, I think I got it now - should have used strlen instead of sizeof to malloc enough memory for the name entered.



    arrayOfNames[m] = malloc(strlen(name) + 1);
    ...
  14. Replies
    29
    Views
    6,966

    That definitely seemed to work for storing my...

    That definitely seemed to work for storing my strings in the array. Thank you. Now... I get an error when trying to free a string that is too large for some reason. I'm not sure if there are any...
  15. Replies
    29
    Views
    6,966

    okay, so even with the warning about memmove it...

    okay, so even with the warning about memmove it still compiles, but it's giving me output that's truncated from what string it's supposed to store like the following:



    CREATED ARRAY AT MEM...
  16. Replies
    5
    Views
    5,992

    Yes. I am using Ubuntu. Unfortunately libc6-dev...

    Yes. I am using Ubuntu. Unfortunately libc6-dev was already installed and it still wasn't displaying manual pages for C functions. I poked around with a search engine quick after you mentioned I...
  17. Replies
    5
    Views
    5,992

    penguin@penguin-laptop:~$ man malloc No manual...

    penguin@penguin-laptop:~$ man malloc
    No manual entry for malloc
    penguin@penguin-laptop:~$ man memcpy
    No manual entry for memcpy
    penguin@penguin-laptop:~$ man memmove
    No manual entry for memmove...
  18. Replies
    5
    Views
    5,992

    "MAN" Manual?

    When I ask some people for help in C code they ask if I've checked the man entry for the function. It seems to be a Unix command line argument - and I've sucessfully been able to pull up entries for...
  19. Replies
    26
    Views
    13,989

    How would anyone check if the program worked if...

    How would anyone check if the program worked if you can't use IO functions from the standard library or self-written (you wouldn't be able to output to a file or a terminal window, or anything)?
    ...
  20. Replies
    29
    Views
    6,966

    Alright, nice - the method compiles with the...

    Alright, nice - the method compiles with the addition of the <stdbool.h> library. It is still giving me a warning. I'm not sure why the compiler is telling me I'm trying to redefine memmove(). I...
  21. Okay, you need to get rid of the: "void master()...

    Okay, you need to get rid of the: "void master() {}" in the header file. The function signatures look good. If you define something in either your header or the C file, the you don't need to...
  22. Replies
    29
    Views
    6,966

    Good point - C was created specifically to design...

    Good point - C was created specifically to design the Unix OS. Why anybody would design anything other than a compiler or OS with it is beyond me.

    I'm still struggling with how to implement...
  23. Replies
    29
    Views
    6,966

    okay, so it doesn't store the integer separate...

    okay, so it doesn't store the integer separate from the string, rather it embeds it, so if I did boundary value analysis on this code it would crash and burn near the upper bounds. Cool.

    When...
  24. Replies
    29
    Views
    6,966

    so, in short, what you're saying is: 1....

    so, in short, what you're saying is:
    1. sizeof(int) doesn't actually give me the size of an integer
    2. nobody is updating the C programming language for 64 bit machines so we have to cover that...
  25. Replies
    29
    Views
    6,966

    #include #include ...

    #include <strings.h>
    #include <stdio.h>
    #include <stdlib.h>


    char ** createArray (int arraysize) {
    char **arrToCreate;
    arrToCreate = (char**)malloc(arraysize * sizeof(char *));
    ...
Results 1 to 25 of 33
Page 1 of 2 1 2