15,554 Topics

Member Avatar for
Member Avatar for Muro29

Hi their, I am learning C and a bit stuck on pointer to strings(I now they dont really exist in c but yeah) which i saw in the absolute guide to c programmig book. I am wondering why this code below doesnt work? If you could answer this question it …

Member Avatar for Lucaci Andrew
0
132
Member Avatar for firdousahmad

Help me plz #include <stdio.h> int main ( int argc, char *argv[] ) { if ( argc != 2 ) { printf( "usage: %s filename", argv[0] ); } else { FILE *file = fopen( argv[1], "r" ); if ( file == 0 ) { printf( "Could not open file\n" ); …

Member Avatar for Trentacle
0
91
Member Avatar for rhowell

Hi, # Problem and Background # I'm trying to compile a program that uses some legacy c code generated using the f2c translator (*version of May 1991 13:06:06*). *decide.c* is the source that contains the translated fortran to c code and *f2c.c* is the header file. Durring compilation I get …

Member Avatar for rubberman
0
430
Member Avatar for jemz

Hi, Can i ask some help what is the best editor to use in learning C language.... By the way which is which language, should or i must to learn C or C++ ?. Thank you in advance.

Member Avatar for Lucaci Andrew
0
313
Member Avatar for summer_21

I want to make a simulation of logic circuits using basic logic gates in C.User will determine the types of inputs, and the gates.I want to design the circuit as a result.And simulation that produces output according to input values​​.But I can't do connections between gates.Can you give me advice …

Member Avatar for dheaven
0
778
Member Avatar for firdousahmad

how the compiler searchs for a file when we write fopen("filename","r"); please draw the flowchart of the whole process

Member Avatar for deceptikon
0
117
Member Avatar for Perry31

Hi, Can anyone suggest me how to set/create Alpha channal like OxaaRRGGBB for 32Bit BMP image?? I used photoshop, Pixelformer to create 32Bit BMP image with Alpha channel but when i open that image in hex editor nothing is set for Alpha channel.

Member Avatar for Schol-R-LEA
0
167
Member Avatar for firdousahmad

#include<stdio.h> #include<conio.h> #include<string.h> struct person { char name[10]; int rno; }; typedef struct person NAME; NAME stud[10], temp[10]; void main() { int no,i; void sort(int N); clrscr(); fflush(stdin); printf("Enter the number of students in the list\n"); scanf("%d",&no); for(i = 0; i < no; i++) { printf("\nEnter the name of person …

Member Avatar for abrarsyed
0
800
Member Avatar for dile

I'm C newbie and i'm having a tough time with my first assignment :sad: The assignment is on creating a Number Puzzle.....apparently it's the newest craze in Toronto and my prof is a big fan....unfortunately I'm trying to read in a file which looks like this: 9,8, ,5,,4,, 7,3,1, ,5 …

Member Avatar for Lucaci Andrew
0
10K
Member Avatar for abrarsyed

#include<conio.h> #include<stdio.h> #include<ctype.h> #include<string.h> int precedence(char c) { switch(c) { case '*': case '/': return(2); case '+': case '-': return(0); } } char *to_postfix(char *infix) { char stack[30],postfix[30]; int i=0,j=0,top=-1; while(infix[i]!=NULL) { if(isalpha(infix[i])||isdigit(infix[i])) { postfix[j++]=infix[i++]; } else if(infix[i]=='(') { stack[++top]=infix[i++]; } else if(infix[i]==')') { while(stack[top]!='(') { postfix[j++]=stack[top--]; } top--; i++; …

Member Avatar for abrarsyed
0
547
Member Avatar for pooh1234qwerty
Member Avatar for pooh1234qwerty
0
186
Member Avatar for bufospro

Hi all, I would like to make program reading 300 lines form a file with 24 columns. the 24th column has an integer from 1 to 24, while the others columns are strings. I want to summarize in seperate files this (last) column For example, assdsd, sdsds, asdasda, asda ,asdad, …

Member Avatar for TrustyTony
0
176
Member Avatar for c_parse

Hello all, I am trying to parse a text file that has the following format: 3 1:3,60,3 2:6,70,1 3:3,50,3 I am supposed to take the first line "3", and allocate memory for the 3 lines after it. Then I want to skip the first line, and start parsing and tokenizing …

Member Avatar for Schol-R-LEA
0
213
Member Avatar for wschamps42

Hello I am new to C and was wondering if someone could just please explain to me what this function does? Thats all I just need help understanding it. I'm new to C so some one the syntax is tough for me to understand and Im not sure what the …

Member Avatar for TrustyTony
0
129
Member Avatar for carrot_123

Hi, I am currently learning how to program, and have a code below: int voltage; printf("Voltage\t\tSoC\tDescription\n"); printf("-------\t\t---\t-----------\n"); for (voltage = voltage_min; voltage <= voltage_max; voltage = voltage + step_size_variable){ printf("%d\t\t%0.3d%%\n", voltage, ((voltage - 3000)/1200)*100); } When I run it, the program outputs only 0.00%s, and is not calculating the voltage …

Member Avatar for TrustyTony
0
3K
Member Avatar for Bencz

I have to develop a simple parser, to read "block" of text for example: /TEST {. text .} /TEST_DATA {. infs .} and, I need to read informations of inside of label.... and... the file with have this informations... have a lot of labels, with the same perfil for example: …

Member Avatar for Schol-R-LEA
0
196
Member Avatar for jnawrocki
Member Avatar for Perry31

Hi, The below is my situation, **Input String :** abc 123$ abc 123$ abc123$abcabcabc 123$ From the above string i want to store the starting index of "123$" code and the "123$" string. When i debugged and found, for first iteration(codecount=0) i'm able to store both index and string but …

Member Avatar for Perry31
0
97
Member Avatar for vvidyadhara

can i add two numbers without using arthemetic operators. can any one do it.

Member Avatar for karthi.k.s
0
370
Member Avatar for abrarsyed

Hi, can we write a function in c, tht can accept any type of array, may tht be int, float, char, struct or of any any kind, as an argument and perform some task of tht like sorting etc. Thank you

Member Avatar for KenJackson
0
129
Member Avatar for spetro3387

I am writting a driver for a GPS unit in linux. I can set on the GPS unit what data it should send out it's ethernet port. The data is arranged in structs of different sizes depending on what it is. For example one packet could be for the GPS …

Member Avatar for L7Sqr
0
91
Member Avatar for kandarpa

Please help me: Following is my program: [CODE]main() { char str[] = "This is //20"; char c[10], *k; int num=0; sscanf(str, "%s%[^//]*//%d",c, &num); printf("%s \n %d \n", c, num); }[/CODE] My intention is to get the first string and last number. I want to ignore the remaining text. There is …

Member Avatar for deceptikon
0
261
Member Avatar for optimus_prime_1

#include<stdio.h> #include<conio.h> struct adj_node { char nam; struct adj_node *adj_next; }; struct node { char name; struct adj_node *down; struct node *next; }; struct node * gins(struct node *); struct node * lins(struct node *); main() { int n,i,j; char c,r; struct node *g,*t; g=malloc(sizeof(struct node)); g->next=NULL; g=gins(g); g=lins(g); getch(); …

Member Avatar for deceptikon
0
741
Member Avatar for CharlieBrook

int main(void) { char faceValue[2]; char suitValue[2]; //User enters the value of their hole cards. setCardFaceValue(faceValue); setCardSuitValue(suitValue); for(int i=0;i<2;i++) printf("Element %i: %c %c\n",i,faceValue[i],suitValue[i]); return 0; } void setCardFaceValue(char* face) { char card[2][20] = {"left card:","right card:"}; for(int i=0;i<2;i++) { printf("Enter face value for "); for(int x=0;x<19;x++) { printf("%c",card[i][x]); if(card[i][x] == …

Member Avatar for Ancient Dragon
0
236
Member Avatar for danielgek

hi im studing on i have this work and its giving me this error: main.c||In function 'get_jogos':| main.c|75|warning: implicit declaration of function 'get_endereco'| main.c|75|warning: assignment makes pointer from integer without a cast| main.c|76|warning: assignment makes pointer from integer without a cast| main.c|122|error: conflicting types for 'get_endereco'| main.c|75|note: previous implicit declaration …

Member Avatar for danielgek
0
245
Member Avatar for shiushiu

need help in this work .... goal This work is to develop a system capable of managing bank accounts. description The banking system consists of a set of two banks where each bank has a manager, responsible for the accounts of that bank. Also part of the banking customers (maximum …

Member Avatar for Schol-R-LEA
0
147
Member Avatar for srg85

I have a data set in .txt format and want to do some arithmetic operation on the data set using C code. How to do the job? I want to make the text data into a 2D-array. The data set is like this: 1st col - year, 2nd col-January rainfall, …

Member Avatar for mridul.ahuja
0
2K
Member Avatar for nee_88

Hi, I have a doubt. Suppose we define a pointer or an array of pointers, and pass it to a function, as in like :- char *p; func(p); /*or this way*/ char *p[10]; /*and then pass this array somewhere to a fucntion*/ func(p); Here, in the call to the function, …

Member Avatar for deceptikon
0
117
Member Avatar for abrarsyed
Member Avatar for Trentacle
0
222
Member Avatar for shibu2all

i am unable to understand the code. can anyone please explain. printf("%d",i & 1) wat is the &1?? int i; for(i=0;i<10;++i) printf("%d",i &1);

Member Avatar for shibu2all
0
113

The End.