Search:

Type: Posts; User: asilvester635

Search: Search took 0.01 seconds.

  1. Replies
    1
    Views
    17,273

    Reading PPM format images

    I’m fairly new to C programming and I’ve been trying to figure out how to do this for 6 hours without any success.

    I’m trying to read this PPM format image, which contains an ASCII header...
  2. It works perfectly now. Thanks.

    It works perfectly now. Thanks.
  3. Alright, when I did that and compiled It told me...

    Alright, when I did that and compiled It told me to change the print line in my for loop of main from printf("%s\n", array[i]); to printf("%c\n", array[i]);.

    I recompiled and it gave me this...
  4. I'm sorry, but my array is in that format...

    I'm sorry, but my array is in that format already. Ultimately I want to store the pointer to an unsigned char* array that I made in makeArray() into an unsigned char* array that I created in main.cc....
  5. Hey, I made the changes, but it's still giving me...

    Hey, I made the changes, but it's still giving me this error

    Error:
    main.cc:13:8: error: array type 'unsigned char *[size]' is not assignable
    array = makeArray(size);
    ~~~~~ ^
    1...
  6. Returning and receiving an unsigned char array

    Why is this giving me a problem? How can I fix it? I'm basically passing a size containing a value of 2 to the makeArray function. Then I make an unsigned char* array Inside the makeArray function,...
  7. Replies
    2
    Views
    1,329

    thanks.

    thanks.
  8. Replies
    2
    Views
    1,329

    "Abort trap" error in c++

    I have an array of size 8, and I send only the second half of the array to my insertion sort. It successfully sorts only the second half of the array, but there is a statement at the bottom, "Abort...
  9. Replies
    2
    Views
    3,750

    I removed the & in front of the array variable...

    I removed the & in front of the array variable when I send it to reverse. Though it gave me what I think is an address location. Below is the output. Why is that? There is no print statement in my...
  10. Replies
    2
    Views
    3,750

    Reversing an array using pointers

    I have this program that makes and populates an array. Then it is sent to a function called reverse, which reverses the order in the array. The compiler keeps giving errors. I'm not quite sure why. ...
  11. I need help with pointers (& and *) and functions

    I'm trying to return the pointer to the variable that has the bigger value using pointers & and *. Below is the source code for my main.cc, functions.cc, and functions.h files. What did I do wrong...
  12. Replies
    2
    Views
    2,261

    I'm using a Macbook pro and sublime text 3 for my...

    I'm using a Macbook pro and sublime text 3 for my text editor. I'm also using my computer's terminal to compile my code.
  13. Replies
    2
    Views
    2,261

    How to use a makefile

    I've written a makefile and saved it under the name "MakeFile" (provided below) for my program. It's in the same folder as my programs.


    all: main


    main.o: main.cc Greetings.cc
    g++ -c...
  14. Replies
    3
    Views
    2,626

    Okay, I changed it to #include , but it...

    Okay, I changed it to #include <iostream>, but it still gave me errors.

    When I tried running the main.cc within sublime text 3, it gave me this error
    Undefined symbols for architecture x86_64:
    ...
  15. Replies
    3
    Views
    2,626

    Creating header files and includes

    I'm attempting to create a function called Greetings, where I put it in a separate file. I followed a tutorial on youtube, but it kept giving me errors. Below is the source code for the main.cc,...
  16. Question about signed and unsigned ints in c++

    What are the largest signed and unsigned ints in c++?
  17. Sorry, there was a mistake in my code. Her is the...

    Sorry, there was a mistake in my code. Her is the correct (I think) code.



    char x = 0xFF;


    if (x < 0) {
    printf("char is signed\n");
    } else if (x >= 0){
  18. I got help from someone. So we are basically...

    I got help from someone. So we are basically setting char variable x with 255. Then if x is less than 0 then char is unsigned, signed otherwise. Can you explain what is happening when char x = 255?...
  19. Is there perhaps another way? I just recently...

    Is there perhaps another way? I just recently started learning about c++, though I do have a background in java.
  20. How to know whether char is signed or unsigned on your system?

    Is there any special function built into the c++ library that accomplishes this?
Results 1 to 20 of 20