You have declared a string using
char s[3];
How many characters can this string hold besides the nul termination character '\0'?
Please post the errors which your compiler is producing...
Type: Posts; User: pheininger
You have declared a string using
char s[3];
How many characters can this string hold besides the nul termination character '\0'?
Please post the errors which your compiler is producing...
I am glad you found your root cause and you were able to correct it.
There is one more lesson possible in your example. Most of your function declarations including the one for remove() are...
I do not think so.
Version 1 "getNumber to be a function "
/* Function definition */
/* getNumber is a function which takes no parameters, returns nothing, and does nothing. */
void...
The following code is a fairly generic "Do you want to continue?" code. This code is untested.
#include <stdio.h>
void PlayAGame(void)
{
/* Replace wth the code for playing a game */
}
What do you think srand() does? It "seeds" the random number generator. In almost all cases (I do not know of an exception), it should only be called once in a program. rand() returns the...
Not quite, in order to incorporate array/matrix in a function, you may define and/or declare it as: <the type of vars inside the array> <the name of the array> <[a1][a2][a3][]...[][an]> (the number...
Also posted here:
signal function definited twice with no error: how is it possible?
As others have indicated, you are having problems without trying to use functions.
Where does the function main() on line 16 end?
Where does the while loop that begins on line 28 end?
What is the...
Commenting on Q1:
In C, the type char is implementation defined if it is signed or unsigned. In C, it is implementation defined whether signed integers use two's complement (most common), one's...
[Removed]
What warnings are you getting when you compile? If none, increase the level of warnings you get.
I am getting several warnings, but two seem to concern me.
On the fseek call, why are you...
It is clear to me that you do not understand what your data structures look like or in other words contain. You need to decide for yourself before you start coding what your data structures would...
You probably think that you have described your problem well. But you have not.
So I am going to ask several questions. You should be able to answer them for yourself. Hopefully, this will...
In addition to the advice you have been given (and will be given) about learning C programming, I would consider some options for improving the situation.
1) Is there more than one instructor of...
Because your open statement uses "/dev/ttyUSB0", I assume that you are using a *nix operating system with a USB simulated serial port. It is not clear from the information you provided if the basics...
I would change the prototype and the definition to be:
void fnMenu(void)
The item in the declaration list:
void fnMenu();
So when do you want to free the matrix A? After the first one or when you get the second one? How can you tell if you already have a matrix A (or B or C or D)?
Using the command sequence from message #27 and the code from message #55, after the first command is given, what is stored for matrix A? Please explain why you think so. Or use your debugger to...
...
@pheininger
Below are the answers to your question:
On line 12, what is the type of the parameter to floor() function? What is the type of the expression num/2?
1. The type of parameter...
On line 12, what is the type of the parameter to floor() function? What is the type of the expression num/2?
What is the purpose of the loop on lines 21 through 24?
What is the purpose of the...
So how do you define "is dividable"?
For example, how do you know if a number (named anumber) is dividable by a possible factor (named apossiblefactor)?
How would your write the contents of the...
So how would you do it by hand with paper and pencil?
For example, how would you know if 17571 is prime or not by using paper and pencil?
What is the definition of a prime?
Or to put it another way, when i is ((unsigned long)UINT_MAX+1UL)/2UL, what is i*2?
Hint: I think it is 0.
Edit: Or to be pedantic, I think it is 0U.
Also posted in devshed forum.
According to ledow's errors and warnings, you have errors on lines 51 and 284 and warnings on lines 85, 87, 89, 91, 99, 100, and 194. Sometimes the actual error is before the line that gets the...