15,550 Topics

Member Avatar for
Member Avatar for fantasma

Greetings, I've got a working flex/bison parser that I would like to run from an exe file. However, I can't find the knowledge to achieve that. Do I need to create a C file, with an exec function to call the files? If so, what files do I call in …

Member Avatar for fantasma
0
284
Member Avatar for reza.adinata

Hi all, I am new in C programming, currently learning about linked list. I know that there is a lot of examples about linked list, but I decided to write my own code, to make me more understand. I managed to build a linked list, insert a new node after …

Member Avatar for reza.adinata
0
383
Member Avatar for Slavrix

hi can someone give this a quick look over and tell me where im going wrong [CODE]#include<stdio.h> #include<stdlib.h> #include<string.h> #include<ctype.h> void main() { struct Rainfall{ char city[20]; int month; int rainfall; }; Rainfall Rainfallarray[18]; int count=0; FILE * readfile; readfile=fopen("CityRain.txt","r"); if(readfile==NULL) { printf("CityRain.txt failed to open."); exit(1); } printf("CityRain.txt Opened\n"); …

Member Avatar for Slavrix
0
113
Member Avatar for chhabraamit

HI, I am looking for faster input and output method for the C other than just normal scanf and printf modules. Please elaborate by simple example. thanks :)

Member Avatar for Narue
0
310
Member Avatar for captalex

i have written code to move a dot from on end of the lcd screen to the other end. [CODE] /*move dot across the creen with pixel increments of 10*/ for(x=10;x<120;x+=20) { Glcd_Dot(x,y,0); Glcd_Dot(x,y,1); Glcd_Fill(0); delay_ms(100); } [/CODE] i have seen examples in C, but this is on a 128x64 …

Member Avatar for andrewll2
0
516
Member Avatar for whitelite

i want to make rot13 encryption this program convert ascii code from a caracter, and work only with uppercase character (65-90) please help me [CODE]#include <stdio.h> #include <stdlib.h> #include <string.h> void rot13(const char *input); int main(void) { char *input; printf("Enter string (max. 255 characters) : "); gets(input); printf("\nConvert result %s …

Member Avatar for andrewll2
0
241
Member Avatar for LesterTheGreat

Your program will have a 3x3 array. The user will input the sum of each row and each column. Then the user will input 3 values and store them anywhere, or any location or index, temporarily in the array. Your program will supply the remaining six (6) values and determine …

Member Avatar for Schol-R-LEA
-1
235
Member Avatar for goyofoyo

so I am in the process of creating a lc-3 compiler that is written in C and I am stuck on how to convert the BR command into C language, the assignment asks that i get a file and then spit it out in zeros and ones , but with …

Member Avatar for TrustyTony
0
244
Member Avatar for Soubhik

Hi Say I want to write a header file as an exercise. It will contain a bunch of functions and some constants. Q1. I noticed that the standard header files only contain the function prototypes. a> Where are the actual functions? b> How do I write a header file such …

Member Avatar for Soubhik
0
213
Member Avatar for dgreene1210

[CODE]#include <stdio.h> void getInput(); void calculate(int num1, int num2, int num3, float num4); void printTable(int num1, int num2, int num3, float num4,int calc1, int calc2, int calc3, int calc4, double calc5, double calc6, float calc7, float calc8); int main (void) { int num1, num2, num3; float num4; int calc1, calc2, …

Member Avatar for dare599z
0
1K
Member Avatar for beatbox32

Hello, I'm attempting to learn C through the K&R book and am having some trouble with Exercise 1-13 at the moment. I'm just attempting to do a simple horizontal graph and can't figure out why this isn't working correctly. It seems to be ignoring my first "if" statement and just …

Member Avatar for beatbox32
0
464
Member Avatar for garap

I want to get some direction which will help me solve insertion sort problem

Member Avatar for Narue
0
42
Member Avatar for Dhanesh10

[CODE]#include"stdio.h" #include"conio.h" #include"alloc.h" struct node { int age; char name[25]; struct node * next; }; void add_end(struct node **q); void display(struct node *); void main() { struct node *p; p=NULL; add_end(&p); //display(p); getch(); return; } add_end(struct node **q) { struct node *temp,*r; temp=*q; if(*q==NULL) { temp=(struct node *)malloc(sizeof(struct node)); printf("\nEnter …

Member Avatar for Dhanesh10
0
364
Member Avatar for VernonDozier

I have the following code. It's a memcmp implementation for the Renesas R5F Embedded Chip family and I'm trying to test it. [code] #include <stdio.h> #include <time.h> #include <stdlib.h> #include <math.h> #include <stdbool.h> #include <stdlib.h> #include <assert.h> typedef char SInt8; typedef unsigned char UInt8; SInt8 one_net_memcmp(const void *vp1, const void …

Member Avatar for VernonDozier
0
205
Member Avatar for VernonDozier

[code] #include <stdio.h> #if 1 //! Set Pin string const char* const ONCLI_SET_PIN_CMD_STR = "set pin"; #endif const char* const SINGLE_APP_STRINGS[] = { ONCLI_SET_PIN_CMD_STR }; int main() { printf("%s\n", SINGLE_APP_STRINGS[0]); getchar(); // pause return 0; } [/code] Line 12 Error message... [code=text] 12|error: initializer element is not constant 12|error: (near …

Member Avatar for VernonDozier
0
328
Member Avatar for TomaCukor

hello ! i have a program id like to code , and it uses from 3 upto 15 members of a structure , id like to ask , [COLOR="red"][I]1,[/I][/COLOR] is there a way to not define all members of a structure at the start but add members as needed ? …

Member Avatar for Schol-R-LEA
0
132
Member Avatar for ricardo.crudo

Hello Everybody. I'm with a classic problem in C preprocessor concatenation. This is the situation: [CODE] #define BAUDRATE(VAL) (B ## VAL) //... const uint32_t BAUDRATE_VAL[] = {1200, 2400, 9600}; //... br = BAUDRATE(BAUDRATE_VAL[i]); //... [/CODE] This code, result in the error: BBAUDRATE_VAL undeclared I need that the result of concatenation …

Member Avatar for Narue
0
94
Member Avatar for anjoz

im trying out using malloc in array of characters by reading each word from that text file and putting it in a array so the array size is exact my problem is when i run the program it makes segmentation fault im not sure where the problem is and if …

Member Avatar for Narue
-1
546
Member Avatar for jenny666

Hello im makin a program in C tht will query my database when i use the following code i get an error "segmentation fault" [code] //retreive configuration items from the mysql database mysql_query(conn, "SELECT callcost FROM imds.testset Where callcost BeTWEEN 900 and 1000;"); results = mysql_store_result(conn);[/code] even when i use …

Member Avatar for Salem
0
283
Member Avatar for stavros141

Hello there, I recently decide to learn and code Windows Services, After I learned the bare basic I thought I would make a program that logs the users program usage every 60 seconds I have coded the same thing without putting it in a service but apparently Services work differently …

0
118
Member Avatar for vedro-compota

Hi ,programmers! Please tell me why it's possible to use such condition - [CODE][U]if (!fork ( ))[/U] return 1;[/CODE] as I know the fork() returns pid_t-type but at the same time "if" needs boolean.. big thanks in advance)

Member Avatar for vedro-compota
0
175
Member Avatar for breatheasier

Hi, I was wondering what libraries there are out there to do some simple sound generation. For example sine waves, square waves etc.. I'm on Linux, so no Microsoft stuff please.

Member Avatar for jbennet
0
163
Member Avatar for megha10

In the below snippet,Rewind() wraps up the file but still the no of records exceed the MAX value set. if(no_of_msg_records >= MAX) { rewind(fp_msg); no_of_msg_records=0; } ie the no_of_msg_records in the file exceeds MAX value.

Member Avatar for abhimanipal
0
85
Member Avatar for anjoz

Ok heres my problem the code is working fine but i cant read extended ascii characters i got a tip that the problem is that extended ascii characters are 16 bits not like the original 8bits per character i dont know where to start can you gets give me tips …

Member Avatar for abhimanipal
-1
1K
Member Avatar for illuminatus89

[CODE]#include<stdio.h> #define UN_IN -1 #define COL 10001 #define ROW 5000 int main() { int r,c; long int a[ROW][COL]; for (r=0;r<ROW;r++) for(c=0;c<COL;c++) { a[r][c]=UN_IN; // b[r][c]=UN_IN; } printf("%d %d", a[34][56],a[12][67]); getch(); return 0; } [/CODE] I was solving a problem which required large input. Am using a two dimension array but …

Member Avatar for Narue
0
108
Member Avatar for reza.adinata

Hi, I am new in C, trying to create a simple C file, that assign a value for a struct member with the type of string. I can't figure out why it said error : string.c:20: error: expected expression before ‘{’ token, but I don't find any syntax error.. [CODE] …

Member Avatar for reza.adinata
0
218
Member Avatar for shimooli

I''ve got a struct like this: struct Node { int n; Node *left; Node *right; } I build up a binary tree from this struct. Now, how can i save the binary tree onto the hard disk, and how can i rebuild it from the hard disk ?

Member Avatar for Narue
0
169
Member Avatar for illuminatus89

[CODE]#include<stdio.h> #include<conio.h> #include<stdlib.h> struct a{ char *c; int b; }t; int main() { scanf("%s %d",t.c,&t.b); printf("%s",t.c); getch(); return 0 ; }[/CODE] I guess there is some problem in receiving input (more precisely in t.c part). Further assistance will be appreciated.

Member Avatar for illuminatus89
0
135
Member Avatar for sharma89bunty

i have a problem related to the c language. [CODE]void main() { int marks; clrscr(); printf("enter the marks of the student:"); scanf("%d",marks); if(marks>=35) { printf("student is pass:"); } else { printf("student is fail:"); } getch(); }[/CODE] but when i run this program, there is no error in the program but …

Member Avatar for mtatadotcom
1
83
Member Avatar for vedro-compota

hi programmers!) Please help me understand this - as I understand from practice - the getting SIGALRM by process is ends the process - but I can't find the explanation of this guess. for exp. - I have code - [CODE]int main(void) { /* Установить будильник */ sleep(1); if((alarm(5)) > …

Member Avatar for vedro-compota
0
112

The End.