I am trying to write a program which implements the Pop and Push functions. The problem is, I am trying to pass the pointer that points to integer Top to the function, so that this integer keeps changing, but when I try to compile I always get this line:
**error: called object is not a function or function pointer (*t)–
#include<stdio.h> #include<stdlib.h> #define MAX 10 int push(int stac[], int *v, int *t) { if((*t) == MAX-1) { return(0); } else { (*t)++; stac[*t] = *v; return *v; } } int pop(int stac[], int *t) { int popped; if((*t) == -1) { return(0); } else { popped = stac[*t] (*t)--; return popped; } } int main() { int stack[MAX];
Related Posts:
- What does “collect2: error: ld returned 1 exit status” mean?
- What does “collect2: error: ld returned 1 exit status” mean?
- dereferencing pointer to incomplete type
- How do function pointers in C work?
- What does “collect2: error: ld returned 1 exit status” mean?
- C compile error: “Variable-sized object may not be initialized”
- How can I use an array of function pointers?
- C compile error: Id returned 1 exit status
- (.text+0x20): undefined reference to `main’ and undefined reference to function
- How to use execvp()
- How to use execvp() to execute a command
- How does strtok() split the string into tokens in C?
- What is *(uint32_t*)?
- what is Segmentation fault (core dumped)? [duplicate]
- uint8_t vs unsigned char
- What is the difference between ++i and i++?
- Using boolean values in C
- How to convert an int to string in C?
- typedef struct vs struct definitions [duplicate]
- How to print in C
- What can be the reasons of connection refused errors?
- What is newline character — ‘\n’
- Why does ENOENT mean “No such file or directory”?
- What does the question mark character (‘?’) mean?
- Cannot figure out how to use getchar(); in C
- makefile:4: *** missing separator. Stop
- c stack smashing detected
- Undefined reference to pthread_create
- Convert char to int in C and C++
- What is Bit Masking?
- segmentation fault : 11
- Strings and character with printf
- Why is the gets function so dangerous that it should not be used?
- Warning comparison between pointer and integer
- Using ssize_t vs int
- Why a warning of “control reaches end of non-void function” for the main function?
- How do I use extern to share variables between source files?
- Cannot assign requested address – possible causes?
- Invalid read of size 8 – Valgrind + C
- error: called object is not a function or function pointer
- munmap_chunk(): invalid pointer
- warning: incompatible implicit declaration of built-in function ‘xyz’
- strcpy vs strdup
- Warning comparison between pointer and integer in C language
- No Symbol Table using GDB on Compiled Programs
- What is char ** in C?
- Difference between scanf() and fgets()
- Return char[]/string from a function [duplicate]
- Is there a printf converter to print in binary format?
- What is a bus error? Is it different from a segmentation fault?
- Difference between char* and const char*?
- Output single character in C
- Get the current time in C
- error: expected primary-expression before ‘)’ token (C)
- Does connect() block for TCP socket?
- Converting a C program to MIPS
- C: linker command failed with exit code 1
- What’s the equivalent of new/delete of C++ in C?
- sizeof float (3.0) vs (3.0f)
- Get text from user input using C
- How to trigger SIGUSR1 and SIGUSR2?
- How do I lowercase a string in C?
- warning: expression result unused
- error: indirection requires pointer operand (‘int’ invalid)
- What is the difference between exit(0) and exit(1) in C?
- What does “%.*s” mean in printf?
- Display value found at given address gdb
- Array definition – Expression must have a constant value
- How to print a char array in C through printf?
- How to clear all the elements of array in C?
- Constant pointer vs Pointer to constant
- Variable warning set but not used
- Expected declaration specifier error in function
- How can I get argv[] as int?
- Why I do get “Cannot find bound of current function” when I overwrite the ret address of a vulnerable program?
- strcmp not working
- C char* to int conversion
- error: aggregate value used where an integer was expected
- char pointers: invalid conversion from ‘char*’ to ‘char’?
- Does C have a string type?
- What are .axf files?
- printf format specifiers for uint32_t and size_t
- error: function returns address of local variable
- What is an simple example of copy_from_user
- What is `S_ISREG()`, and what does it do?
- typedef struct pointer definition
- Math constant PI value in C
- Return a `struct` from a function in C
- C: scanf to array
- The code does not execute properly. Try to figure out why
- What are “prototypes” in a C program?
- ld.exe: cannot open output file … : Permission denied
- How to read from input until newline is found using scanf()?
- What’s the difference between “mod” and “remainder”?
- What is char ** in C? [duplicate]
- undefined reference to `std::ios_base::Init::Init()’
- previous declaration of ‘function’ was here in C [duplicate]
- segmentation fault using scanf
- How to Compare 2 Character Arrays [duplicate]
- segmentation fault with strcpy [duplicate]