My compiler says:
gcc -Wextra -Wall -pedantic -std=c99 -o monsters monsters.c
monsters.c: In function ‘main’:
monsters.c:11:19: warning: assignment makes pointer from integer without a cast...
Type: Posts; User: talahin
My compiler says:
gcc -Wextra -Wall -pedantic -std=c99 -o monsters monsters.c
monsters.c: In function ‘main’:
monsters.c:11:19: warning: assignment makes pointer from integer without a cast...
Hi,
You should lookup integer divisions.
Also you're still missing some semicolons.
Cheers
If you want the rightmost occurrence, maybe searching from they right would be easier.
for (i = strlen(s); i >= 0: i--) {
if ( strstr( s + i, t ) != NULL ) { // found it
return i;
...
Does this even compile?
Try to read A development process
And then try to build your program up slowly adding one function at a time.
So start with a program that has 2 functions. One that fills...
Take a good look at line 7 (the strcpy). Is this really what you want to do?
Also try to increase the warning level of your compiler.
Cheers
Maybe you could read the wikipedia artikel about it.
Cheers
Maybe you should reread your documentation on strcpy_s. Especialy the amount of parameters it uses and its return value.
Cheers
Just paste your code between code tags
#define _CRT_SECURE_NO_WARNINGS
#include<stdio.h>
#include<math.h>
#include <stdlib.h>
#include<time.h>
Try looking up the srand() function.
Cheers
Maybe you should close your output file after you wrote all your data.
Thanks for using code tags, but please use a consistent indentation, your code is still hard to read.
And finally take a...
Why do you think it should be [1 1].
Remember the x in void f(int x) is a local variable and has no meaning outside the function.
if you want to return a value you can declare the function as...
Hi,
your second problem lies in this part.
for (i=0; i<size; i++){
if ((strcmp(sur,a[i].epwnymo)) && strcmp(name,a[i].onoma) ){
x = true;
break;
}
else{
Maybe you should include stdio.h, because that is where printf normally is defined.
Cheers
If this code compiled without errors, you really need to increase the warning level of your compiler. Just skimming the code, your menu function contains at least 2 mistakes your compiler should warn...
So, you allocate a datablock and assign it to a variable that will get lost when the function returns. Also you don't check if the memory really got allocated in the first place.
Cheers.
Hi
Check line 49 for(i=0;i<2;j++)
Edit: Nominal Animal was the faster one. :)
Cheers
Hi,
First it's not the "?" operator, but "? :" operator. It's a ternary operator, meaning it needs 3 operands.
As you noticed, leaving out one of the operands will make the compiler complain.
...
Hi,
Try
if (state != digitalRead(PinBtn)) {
state = digitalRead(PinBtn) , TurnLed(state) ;
}
Also you're reading the button 3 times in your loop. What happens if the button is...
Hi,
The second and third operand of a ? : operator need to have the same type. Because there is no second operand the compiler can't deduce the type of the operand.
Try to rewrite the statement as...
Why are you generating a new list of random numbers in every function call?
void print_random_numbers(int random_numbers[], size_t n){
generate_random_numbers(random_numbers);
Hi,
as to add to whiteflags comment. Original malloc would return (char *) and casting was needed. If I recall correctly C99 redefined the return from malloc as (void *) and casting is no longer...
Hi,
for(i=1;sum[i]>0;i++){
printf("%i--",sum[j]);
}
You're printing sum[ j ], but j isn't initialized anywhere in your code and neither is is it modified anywhere.
I would think cranking up the warning level of the compiler would be the first thing to do. The compiler should at least generate a warning when trying to return without a value in a function that...
To late with my answer again, but still here's my response
#include <stdlib.h>
#include <stdio.h>
int main(int argc, char *argv[]) {
Hi,
char *p = sp->arrayString[i];
You are declaring a pointer to a char, but you don't reserve space for the data p is pointing to. This means p is pointing to a random location. Then...