15,552 Topics

Member Avatar for
Member Avatar for nonadoes

Hi guys, i'm new here and new to c/c++ programming. could you guys guide me how to extract some character/number from a char string? Example: char = TAGNAME_C123_V45_S67_M89 i want to extract the numerical number next to the character. The TAGNAME and the number is varies. So my code should …

Member Avatar for nonadoes
0
217
Member Avatar for melissa.johns

I am attempting to see have much run time a program takes, and eventually check the runtime of different pieces of the program. (As it runs it seems to get slower and slower without explanation) Anyways, I tried the sample code posted on a super simple program. If I wanted …

Member Avatar for jephthah
0
98
Member Avatar for GDICommander

Hello, everyone! I have a problem with memory free. Here is the necessary code to understand the problem: [CODE] void fillArray(char** referenceArray, FILE* grid) { //ChaĆ®ne qui va contenir une ligne du fichier. char* lineContent = malloc((width + 1) * sizeof(char)); //Pour contenir le "\0" int i, j; for (i …

Member Avatar for jephthah
0
289
Member Avatar for Whilliam

Hello.. Im trying to pass an integer to a function by adress because I want to change the value of the integer in the function. But it will not.. please help. Here is my function call: [code=c] insert_sorted(&VH, &L, n); [/code] Here is my function: [code=c] void insert_sorted(VirtualHeap *VH, LIST …

Member Avatar for tux4life
0
90
Member Avatar for edenn1

i have already posted here about my linked list facebook program and i have anoter problem with the function : void cancelFriends(int id1, int id2, PersonList* allPersons) here is the structs again : typedef struct Person { int id; char* name; struct PersonList* friends; } Person; typedef struct PersonList { …

Member Avatar for wildgoose
-1
181
Member Avatar for 9868

here is a code [CODE] #include<stdio.h> int main(void) { int b[10][5] ; int (*q)[10][5] = &b ; printf("%d", (char*)(q+1) -(char*)q); } [/CODE] the output it produces is 200 while if I change the typecast to (int *)(q+1)-(int *)q, the output is 50. I know that q is a pointer to …

Member Avatar for Tom Gunn
0
86
Member Avatar for csayantan
Member Avatar for DoEds

this is our homework... // make a c program that will ask any number from the user. //Output all numbers multiples of 3 from number to 30. [ICODE]// make a c program that will ask any number from the user. //Output all numbers multiples of 3 from nuber to 30. …

Member Avatar for tux4life
0
104
Member Avatar for linkingeek

Here is the code building a table of contents which i felt correct from every sense but output is somewhat unsatisfactory. [code=c] #include<stdio.h> #include<limits.h> #include<stdlib.h> int**buildtable(void); void filltable(int**table); void processtable(int**table); int smaller(int first,int second); int larger(int first,int second); int rowMinimum(int*rowPtr); int rowMaximum (int*rowPtr); float rowAvg(int*rowPtr); int main() {int**table; table=buildtable(); filltable(table); …

Member Avatar for linkingeek
0
107
Member Avatar for OffbeatPatriot

[code=c] #include <stdio.h> int main() { printf("hello\n"); return 0; } [/code] It's all the more frustrating because I've designed stuff MUCH more complicated on this computer. My errors seem to be all linking errors. I've done all I can think of, which was really just to make sure my subsystem …

Member Avatar for OffbeatPatriot
0
586
Member Avatar for monkey_king

If I simply just want to tokenize the first element of a string and then output the remainder of the string, how can this be accomplished? thanks [CODE=c] #include <stdio.h> #include <string.h> int main(){ const char* line= "0 firstline"; char* l = strdup(line); printf("beforeToknization:\t%s\n",l); char *tok = strtok(l," "); printf("firstToken:%s\trestOfLine:%s\n",tok,l); …

Member Avatar for jephthah
0
3K
Member Avatar for 9868

Here is a code [CODE] #include<stdio.h> int main(void) { int a; a=f(10,3.14); printf("%d",a); } int f(int aa,float bb) { return (aa+bb); } [/CODE] If I run the code it produces garbage value, but if I declare the prototype of the function before main it produces the correct output as 13. …

Member Avatar for jephthah
0
268
Member Avatar for edenn1

irealy dont know how to sort my liked list . i should sort it by friends and by name . please try to help me...... i dont know even how to start. here is my structs : [code] typedef struct Person { int id; char* name; struct PersonList* friends; } …

Member Avatar for Tom Gunn
0
106
Member Avatar for Pavan_

[CODE] #include<stdio.h> int main() { int i=10,j=30; printf("%d %d",i,j); // this line printing value of i and j...works fine printf("%d %d"); // this line again printing value of i and j printf("%d"); // this line printing value of i return 0; } [/CODE] On gcc compiler, 2nd and third printf() …

Member Avatar for Tom Gunn
0
147
Member Avatar for spidyshiva

i want an algorithem for image compression and audio compression pleaseeeeeeeeeeee help me

Member Avatar for tux4life
0
95
Member Avatar for Pavan_

here is the code.... [CODE] #include<stdio.h> int main() { int *k; *k=10; printf("%d %d",k,*k); return 0; } [/CODE] it compile perfectly. but on executing it is giving segmentation fault. where is the problem?

Member Avatar for tux4life
0
239
Member Avatar for ngjinjin

I don't know why my interrupt handler doesn't work... can anyone of you please help me? ): Below is my code (the highlighted part is my interrupt handler): #include <hidef.h> /* for EnableInterrupts macro */ #include "derivative.h" /* include peripheral declarations */ #include "IIC.h" #include "LEDs.h" #include "ICG.h" #include "Delays.h" …

Member Avatar for Nick Evan
0
189
Member Avatar for Rodman2009

How did you disable the Unicode, I used the same program and get the same errors, I tried to disable the Unicode by going to the properties of the program, and unticked the inheritance, but I still get the errors?

Member Avatar for Nick Evan
0
148
Member Avatar for MrNoob

Hey i m reading tutrial about rucursion and got code whish isnt complicated or anything but i dunno why it prints the way it does [code] /* recur.c -- recursion illustration */ #include <stdio.h> void up_and_down(int); int main(void) { up_and_down(1); return 0; } void up_and_down(int n) { printf("Level %d: n …

Member Avatar for ankush chander
0
138
Member Avatar for macdonpr

Hello, I am currently just getting started in learning my first programming language. I searched the web and decided to start with the book "The C Programming Language". The problem is I am already lost. I have no idea how to set up the Hello World program. I have a …

Member Avatar for rampurhaat
0
177
Member Avatar for Whilliam

Hello.. How can I read a link list from a file without reading a garbage node? I don't know much about how file works.. This is my code fragment: [code=c] for(p = A; flag != 1;) { *p = (LIST) malloc(sizeof(celltype)); if((fread(*p, sizeof(celltype), 1, fp)) == 0) flag = 1; …

Member Avatar for rampurhaat
0
193
Member Avatar for MrNoob

in my switch program keeps reading wrong input also i know i used way too much fflush(stdin); because stupid printf keeps inputting to the screen so scanf gets bad but i m sure i desinged program nice i dunno why when i like enter num 5 it keeps reading artichokes …

Member Avatar for MrNoob
0
150
Member Avatar for monkey_king

Hi, given a cstring, I need to extract the digits in it, the digits are prefixed with either a '+' or '-'. Like [CODE] ,.,.,.,+3ACT,.,.,.,.-12,.,.,.,.,.,.,.,actgncgt #OUTPUT 3 12 [/CODE] I've made a working program that does what I want, but it seems overly complicated. Does anyone have an idea if …

Member Avatar for Yrth
0
148
Member Avatar for mrayoub

hi, well this is my first post on this great forum, hope to be a good boy :) i m writing a programm that adds numbers from 0 to any numer entered by the user . for Example : - if the user enter 4, the sum will be 10 …

Member Avatar for ajay.krish123
0
166
Member Avatar for ajay.krish123

I am getting problem to work with the structures..I am works on DBMS project in c languge . I wanted to use multiple structures without the use of the pointers but unable to use it as: [CODE] struct File1 { ----- ----- }f1; struct FILE { --- --- struct File1 …

Member Avatar for csurfer
0
135
Member Avatar for Abdo99

a function that take as input two linked lists of character and determines if the first is a sub list of the second. for example if the first list 'e'-->'l'-->'l'and the second is 'h'-->'e'-->'l'-->'l'-->'o' the function returns true

Member Avatar for Nick Evan
0
131
Member Avatar for tyserman5674

Hi Everyone, I need help with using isdigit in C. What I am trying to do is verify that the user input is numeric. In my program, as is, I get the error: line (21) : error C2061: syntax error : identifier 'isdigit'. If I remove the "if" from in …

Member Avatar for tyserman5674
0
142
Member Avatar for Whilliam

hello.. its me again and Im having problems with files again..this time, its with link list.. I can't get my program to display the contents it reads from a file. Please help.. I want to solve this myself but I have no time, my exam will start in 1 hour..:( …

Member Avatar for csurfer
0
170
Member Avatar for Whilliam

Hello.. im having a problem with my code.. when i save a file, then choose another variable and load the file, then try to display it, all that it display are garbage values.. i know the problem is either in function save_file or function load_file.. can anyone please help me.. …

Member Avatar for csurfer
0
216
Member Avatar for Hiroshe

I'm trying to write my own function from scratch to add large numbers. This function takes the input of an unsigned long long array, with each number being 10 didgets long (the reason for the long long signed is becouse I might expand it) and adds it to the output …

Member Avatar for Hiroshe
0
201

The End.