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...
Type: Posts; User: asilvester635
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...
It works perfectly now. Thanks.
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...
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....
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...
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,...
thanks.
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...
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...
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. ...
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...
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.
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...
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:
...
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,...
What are the largest signed and unsigned ints in c++?
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){
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?...
Is there perhaps another way? I just recently started learning about c++, though I do have a background in java.
Is there any special function built into the c++ library that accomplishes this?