Tags down


error: expected identifier or '(' before '=' token

By : priya
Date : September 16 2020, 02:00 AM
To fix the issue you can do I don't really understand why it doesn't work if somebody can help me , Defining a type-alias with typedef has the general syntax
code :
typedef type name;  // Define "name" to be an alias of "type"
typedef struct T_Case T_Case;  // Define "T_Case" to be an alias of "struct T_Case"
// Define a structure with the tag T_Case,
// and a type-alias of that structure with the same name
typedef struct T_Case{
    int abs;
    int ord;
} T_Case;
typedef struct T_Tab_Case case_b;
struct T_Tab_Case case_b;  // Define a variable
T_Tab_Case case_b;  // Define a variable

Share : facebook icon twitter icon

error: expected identifier before '=' token

By : Cervantes Ayres Filh
Date : March 29 2020, 07:55 AM
I hope this helps you . A typical problem in such cases is a conflict with some macro name defined in some header you included. In your case that would be IN, which in some implementations (MS?) is used as a macro for designating input parameters in functions.
A good idea would be to give your enum constants a prefix, like UNIT_UNKNOWN instead of just UNKNOWN. Alternatively, you can do #undef IN after including all "system" headers, but this approach can easily end up being very "high maintenance". A better idea would be, again, to avoid using short all-caps identifiers.

error: expected identifier or ‘(’ before ‘}’ token

By : Maaz ul Haque
Date : March 29 2020, 07:55 AM
wish of those help I am making a small life and poison counter for a game called MTG(Magic the Gathering), and I cam across some problems that wont let me compile can anyone help? Sorry if they're simple, I'm new to C... , You haven't closed the main function correctly.
code :
#include <stdio.h>
#include <stdlib.h>

int life = 20;
int poison = 0;
int amount;
char pn;
char lp;

int main(int argc, char* argv[]) {

        printf("Life:%d\nPoison Counters:%d\n\n\n", life, poison);
        printf("\n\n<Life or Poison>(l/p) <positive or negative>(+/-) <amount>(#)\n\n\n>>>");
        scanf("\n\n%c %c %d", &lp, &pn, &amount);
        if(lp == 'l'){
            if(pn == '+'){
                life = life + amount;
                life = life - amount;
        }else if(lp == 'p'){
            if(pn == '+'){
                poison = poison + amount;
                poison = poison - amount;
        }else if(lp == 'q'){
    return 0;

error: expected identifier before '(' token

By : Kids School Singapor
Date : March 29 2020, 07:55 AM
it fixes the issue That should be easy fixing. Your Problem should be easily fixed, if you change these lines:
code :
if ( BMI >= 18.5 ) && (BMI <= 24.9) 
if (( BMI >= 18.5 ) && (BMI <= 24.9))

how to fix expected identifier before ';' token error

By : equitesl888
Date : March 29 2020, 07:55 AM
around this issue Welcome to Stack Overflow.
I think I can discern your intent from the comments on the question and the other answer, and I believe what you want for your core loop is something more like this:
code :
kitap_ozellikleri gecici1;
kitap_ozellikleri liste[6] = {a, c, y, e, t, k};  // no 'quotes'
char yazar_liste[6] = {'e', 'g', 'k', 'r', 'o', 'o'};
for(n=0; n<6; n++) {
    for(z=0; z<6; z++) {
        if(yazar_liste[n] == liste[z].yazar){
            gecici1.sayfa += liste[z].sayfa;

typedef struct{
    char isim;
    int adet;
    int odunc_alinma_sayisi;
    int sayfa;
    char yazar;

kitap_ozellikleri a = { 'a', 50, 30,  280, 'e' };
kitap_ozellikleri c = { 'c', 82, 88,  150, 'g' };
kitap_ozellikleri y = { 'y', 99, 123, 119, 'k' };
kitap_ozellikleri e = { 'e', 53, 33,  268, 'r' };
kitap_ozellikleri t = { 't', 24, 42,  159, 'o' };
kitap_ozellikleri k = { 'k', 55, 110, 296, 'o' };

int main(){
    int n, z, tot;

    kitap_ozellikleri liste[6] = {a, c, y, e, t, k};  // no 'quotes'
    char yazar_liste[6] = {'e', 'g', 'k', 'r', 'o'};
    for(n=0; n<5; n++) {
        tot = 0;
        for(z=0; z<6; z++) {
            if(yazar_liste[n] == liste[z].yazar){
                tot += liste[z].sayfa;
        printf("total pages for sayfa %c is : %d\n", yazar_liste[n], tot);

    return 0;
total pages for sayfa e is : 280
total pages for sayfa g is : 150
total pages for sayfa k is : 119
total pages for sayfa r is : 268
total pages for sayfa o is : 455

getting the error: expected identifier or ‘(’ before ‘{’ token

By : Ennam Hoque
Date : March 29 2020, 07:55 AM
Any of those help Getting this error : expected identifier or ‘(’ before ‘{’ token on the first bracket after the #include before the int main. No clue why! Doing an assignment for an introductory programming course. It's due today so any help would be appreciated!
Related Posts Related Posts :
  • Is that fixed-size array? a[]
  • It is not outputting what was expected and am unsure as to the issue
  • i want use C shell code to make buffer overflow and execute bin/sh
  • what the main function in this program returns to os?
  • Suffixes for integer types
  • I don't understand why a equals 1 and b equals 0 in this program
  • C prints other integer number than what it shows on Watches. Why is that?
  • Output of the for loop?
  • How to find 64-bit divisions in existing C code?
  • Finding a numbers with the largest/smallest number of bits set
  • how does " for (int j = 0; j < n || !putchar('\n'); j++) " work
  • handle ctrl+c in client-server socket in c programing
  • Restrict a process to read "/etc/resolv.conf" file in linux
  • Restrict scope of global variable inside one file in C
  • Arduino AES128 encryption - decryption problem
  • Why is not ampersand needed in the following code?
  • Is it possible to define a function name with #define?
  • Why is the size of the data type different when the value is directly passed to the sizeof operator?
  • Segmentation fault / Incorrect checksum triggered ocasionally when reading lines from a file
  • Adding bits at specific indexes for a uint8_t block
  • how can I use "shadow call stack" feature of clang-8 in x86_64?
  • malloc Assertion Failed
  • Array of structs inside of another struct in C
  • Why does this print the wrong part of the string?
  • Moving the cursor and printing characters in console doesn't work with sleep
  • Confusion in adding an element to a sorted list of integers
  • How I can separate integer number in 3 "houses"? Hundred, Ten and Unity
  • User-implemented memory management
  • What it entails to declare and initialize a pointer in this way: int (*p)[n]
  • Function to look though any struct in C
  • Microcontroller not recognized at USB port when connected via pins
  • Unexpected bitshift behavior in C
  • Model 3D spring from points
  • C control reaches end of non void function
  • Tax outputting 0
  • Gtk 3.0 Text View Resizable
  • Statically linking libc into my binary causes it to segfault
  • Child Process Executing Print Statement But Nothing Afterwards
  • Why is the function to find factorial wrong?
  • I am making a prime number checker: when I try to run it, it stopped working
  • I dont understand how this code can display a string by using just getchar
  • Traversing binary search tree, how to advoid code duplication
  • memcpy() overflow? Every eighth byte has its same bit pulled down when reading from FLASH
  • Warning: passing argument 2 of 'transform_labels' from incompatible pointer type [-Wincompatible-pointer-types]|
  • Is there any way i can print n lines with n columns where (1,1) is 1 ... (1,n) is n then (2,1) is 2 ... (2, n-1) is n an
  • Why am I getting some random values after the output?
  • C Program behaves differently if compiled using CLion rather than using gcc directly. Why?
  • Implementing CURL command using libcurl in C/C++
  • Changing number from character array to int array with decimal value
  • Finding certain words in a string in the loop
  • Warning C4047 : '=': 'int' differs in levels of indirection from 'int *'
  • Array with random numbers only contains the same values?
  • How to read line with space through redirection operator?
  • CLang-Tidy warning that rand() has limited randomness
  • format string '%g' requires an argument of type 'double', but variadic argument 1 has type 'long'
  • Cannot declare a void function before the main() in C
  • C: How to iterate over all possible values of `signed int`, from `INT_MIN` to `INT_MAX`?
  • How do I make button label translations work in GTK?
  • Why does C have both logical and bitwise ‘or’ operators?
  • can GOTO create an overflow in stack memory? StackOverflow?
  • shadow
    Privacy Policy - Terms - Contact Us © 35dp-dentalpractice.co.uk