I implemented the second in my code and it didn't work...
I replaced it with first and it works fine....
Type: Posts; User: nishkarsh
I implemented the second in my code and it didn't work...
I replaced it with first and it works fine....
Whats the difference between
void swap(int* a,int* b)
{
int x=*a,y=*b;
x=x+y;
y=x-y;
x=x-y;
I am new with vectors and STL library. please tell where I'm going wrong?
int t,i;
char ch;
char arr[400];
vector<char> exp;
stack<char> s;
here's the code
...
#define SIZE_MAX 100
typedef struct stack {
char data[SIZE_MAX];
int size;
How is my usage of malloc wrong??
typedef struct stack {
char data[SIZE_MAX]; // SIZE_MAX #defined as 100
int size;
} stack;
stack *s=(stack*)malloc(sizeof(stack)); //line# 11
Here's a part of the add_token() function. (The part that I've truncated is a few if-else statements that recognize tokens and add them to a linked list)
void add_token() {
struct lex...
Following Salem's advice, I added a breakpoint and stepied....
This is what happens
This goes on for some time but I think "that '??' cant be good"
Am I right?
This is what bt gives me...
> Program received signal SIGSEGV, Segmentation fault.
> 0x080487be in add_token ()
> Current language: auto; currently asm
> (gdb) bt
> #0 0x080487be in...
could you please explain what has happened here?
> Program received signal SIGSEGV, Segmentation fault.
> 0x0804885d in add_token ()
> Current language: auto; currently asm
to compile multiple files you can write a shell script which includes complation statements for all files...
Are there any libraries in C for building lexical analyzers/scanners?
I am planning to design a Lexical Analyzer for C language for a project.
how difficult is it?
how difficult is it to design it 'in' C itself?
what are the things that I need to know?
its working now
thanks ppl
Thx for your reply...
I've made the changes u suggested... but the prob still persists...
the modified code is;
#include <stdio.h>
int main() {
The code below to append a file is giving segmentation fault...
It takes the input but doesnt print DONE..
Plz help me out...
#include <stdio.h>
main() {
char * ptr;