15,552 Topics

Member Avatar for
Member Avatar for saw77

[code]#include<stdio.h> #include<stdlib.h> main(){ char *tab; int n; int i; char c; printf("dimension du tableau?"); scanf("%d",&n); tab=(char*)malloc(n*sizeof(char)); printf("remplir le tableau :"); fflush(stdin); gets(tab); for(i=0;tab[i]!='\0';i++){ printf("%c",tab[i]); } }[/code] let's say i just want 5 letters in tab,so i run the program and put n=5,but what i don't get is that if i …

Member Avatar for saw77
0
211
Member Avatar for sdinu96

[code]#include<stdio.h> #include<stdlib.h> #include<string.h> struct name { int a; char b[10]; char c; }; int main() { struct name *p; p = (struct name *)malloc(3 * sizeof(struct name)); char *n; n = "12345"; n = (char *)p; n = (int*)n; /*this is not correct . in doubt....change correctly*/ strcpy(n+(sizeof(p->a)),"ALL"); *(n+sizeof(p->a)+sizeof(p->b)) = …

Member Avatar for abhimanipal
0
109
Member Avatar for Don_k

The aim of the program is to add ten numbers then output their sum. I can do this but in a very basic way. for instance the only way I know how to do this is by adding each array and thats quite tedious and long is there any way …

Member Avatar for Aia
0
74
Member Avatar for Tellalca

I've been developing console applications using C/C++. I now want to move on and create some GUI applications. For that i saw some libraries to create GUI. I think those libraries are OS dependent. How can we create GUI applications compatible with Linux, Windows and Mac, or is it even …

Member Avatar for gerard4143
0
106
Member Avatar for sdinu96

{ int i = 25789; char *p; .............. .............. printf("%d",*p); /* (*p) should give in printf*/ } dont assign p=i ............apart from this how we can typecast this program so that we can get interger value tp pointer p.............please help me this

Member Avatar for Ancient Dragon
0
86
Member Avatar for happy101

i would like to know how i mean when i scan image how it is transfer to computer in basic .aslo can i know the code scan file or image.

-3
25
Member Avatar for didi00

Hi everyone! So can someone explain me how to compile a file with gcc? I'm using kubuntu, and I've written my source code in Kate(the text editor), and I saved it in documents like file1, and now how to compile it from the terminal? I've tried with the command: [code] …

Member Avatar for didi00
0
249
Member Avatar for Wizablue

I'm trying to make a program,it's almost done... but i'm stuck on an error message that I get. I would appreciate any help. The error message: [QUOTE]error: conflicting types for ‘findEntry’ note: previous implicit declaration of ‘findEntry’...LINE 15[/QUOTE] I get it for this code: [CODE] catalogPointer findEntry(catalogPointer head, char names[]) …

Member Avatar for Wizablue
0
357
Member Avatar for baby_c

hey guys i'm new to c and still learning.need some help here. i wrote this code and it isn't work properly,unable to figure out whats wrong!!but when the [B]strget()[/B] call from the main() its working.please some help... [CODE]main() { int x; printf("enter a value :"); scanf("%d",&x); switch(x) { case 1: …

Member Avatar for Aia
0
172
Member Avatar for saravanan.cse
Member Avatar for preethis
Member Avatar for absolutely
1
531
Member Avatar for sdinu96

[code]#include<stdio.h> #include<stdlib.h> #include<string.h> struct name { int *a; char b[10]; char c; }; int main() { struct name *p; p = ( struct name * ) malloc ( 3 * sizeof ( struct name ) ); char *n; n = ( char * ) p; *n = 275; strcpy ( …

Member Avatar for Banfa
0
441
Member Avatar for sgriffiths

Hello I would like to count how many words are in a string ie "PETER JOHNSON LTD" so this string contains 3 I was going to use strtok but this is too slow. Any other ideas?

Member Avatar for jephthah
0
268
Member Avatar for iwanttolearnc

Good day to you guys! im having a bit of a problem using strtok. im currently tinkering with extracting gps data, which are separated by commas. ive seen code in several forums but most of them assign the output of strtok to the same char pointer. what i want to …

Member Avatar for jephthah
0
196
Member Avatar for speedy94519

Hey guys. So I basically read in a bunch of data from a file into a data structure. But while I was doing that I included the spaces (which I dont want). So now I want to compare each element to see if it does have a blank space, and …

Member Avatar for speedy94519
0
293
Member Avatar for Tellalca

I wonder why the following code work. In the debugger i see that every thing works fine but after the "root = createNode(item);" statement I can't see the new node assigned to root? [CODE]Node *insert( Node *root, int item ) { if(root==NULL) root = createNode(item); if(root->data>item) insert(root->left,item); else if(root->data<item) insert(root->right,item); …

Member Avatar for Tellalca
0
89
Member Avatar for Peter The Rock

i have this assignment due tommorow ive tryed it but it seems tuffer than what it should. anyone have any ideas? Write a function stage 1() that reads one of Tommy’s data files into a suitably declared and named data structure. You should assume that there will be at most …

Member Avatar for Aia
0
136
Member Avatar for simmi...

need help- create a tree(simple m-ary),with each node having 4 dataitems & 5 children. "IN C-language" just 1 example showing 1 or 2 node created will be really helpfull(as this is tedious)........i have all operation clear till binary tree...but this 1 is not clicking!!!!..... or in case u knw any …

Member Avatar for abhimanipal
0
148
Member Avatar for westsider123

I posted this thread but it got transferred to another, can someone edit the code for me so that I can get the answer in exponentiation, (^)and(*), Example : Enter number : 8 Prime factors of '8' : 2^3 Enter number : 56 Prime factors of '56' : 2^3*7 [B][U] …

Member Avatar for abhimanipal
0
105
Member Avatar for ellenski

My program is a very simple address book program. The program works but i don't know how to make it display the same names. Like for example, the name "Mark Lee", if there are more than one Mark Lee, i would like to display all of those Mark Lee w/ …

Member Avatar for kvprajapati
-4
297
Member Avatar for Narue

In answer to a coworker's question today about memory management today, I wrote the following code. It's an implementation of the gets function that accepts an infinite length string (bounded only by the heap) and [i]does not[/i] force the caller to free the resulting pointer. I figure that it's a …

Member Avatar for Narue
3
372
Member Avatar for james85

i have a problem when i use: [code] do { printf("press only A to continue):\n"); x=getchar(); }while(x!='A'); [/code] if i press anything the program prints me the message multiple times

Member Avatar for Aia
0
148
Member Avatar for oracle123

Hi all, I am using the following function which I found online to trim the leading and trailing whitespaces from a passed in string. It works fine for all the cases but I am having trouble in understanding the process being a newbie to C world. [CODE]char *trim (char *str) …

Member Avatar for Aia
0
743
Member Avatar for myth_terry

hello frns.. :icon_smile: i am in need of a code that does the following very very urgently.. please please help me !!! [CODE]read strings from a text file "text1.txt" (which are stored 1 per line without spaces) and store these strings in a string array A[]. then read strings from …

Member Avatar for myth_terry
-3
215
Member Avatar for kavourdoukos

How can i make sscanf() skip all whitespace characters?I read from a file and i dont know where are the characters. eg.->@Solomon Islands ,i need "Solomon Islands" in one string e.g->AGAF (AFT) – Afutara Airport – Afutara ,i need "Afutara Airport" in one string.

Member Avatar for Narue
0
7K
Member Avatar for javedkhan0258

I want to know how to read from a file. I have posted the first line of program.dat file before. There are more than one line in the file and i want to tokenize them and save them into different variables or pointers. Can anyone write full code how to …

Member Avatar for Aia
0
466
Member Avatar for MADHAN RISHE

can anyone help me for a simple polynomial addition using list.. no matter how long it is .. but it must be simple ...

Member Avatar for jephthah
0
191
Member Avatar for kavourdoukos

I would like to read a text file and store to strings some data that are important for me.I tried to do with strtok but wasnt successful?Can u help pls? [QUOTE]txtExample @Greece ASAS (FFF) - BLALAL BALLA BLALALAL - JAJAJAJAJ, XAKALXKAL ZMAH (AVK) – Arvaikheer Airport – Arvaikheer, Ovorkhangai ZMBH …

Member Avatar for abhimanipal
0
113
Member Avatar for dfetter88

Is there a systematic method to analyze the time complexity of a program strictly from output data such as run-time, the number of data swaps, data comparisons, etc? For example... [icode] Data Size | Run Time | Comparisons | Moves --------------------------------------------- 1000 | 0.00 | 15448 | 23965 10000 | …

Member Avatar for Banfa
0
119
Member Avatar for priyarao

hi i am doing code on single linked list in that i hav to save elements of my list to a file and then load it. The file is not loading pls check this code [CODE]#include<stdio.h> #include<stdlib.h> struct llist { int info; struct llist *next; }; typedef struct llist linked_list; …

Member Avatar for technology
0
119

The End.