15,550 Topics

Member Avatar for
Member Avatar for Perry31

Hi, Anyone suggest/Explain code optimization, time complexity of program. I came across Big O(n), Big O(...). can anyone explain what these means and how to find these for programs. -- Thanks in advance

Member Avatar for Perry31
0
681
Member Avatar for ashine80
Member Avatar for niyasc

Hi, I'm trying to make a simple applet that will display battery status using gtk+ . For that purpose I have written code given below. It continously check for battery status using acpi command and display it. Do you think that I have done things in proper way? I want …

0
191
Member Avatar for ashine80
Member Avatar for ashine80
Member Avatar for ashine80
Member Avatar for salmansaifi7

i want to append a node in the linked list when i append this as struct node*p; p=NULL; append(p,1); where function is declared as append(struct node*q int num) i append three node, after this i call the function for counting the node, i get the total no node is 0, …

Member Avatar for Schol-R-LEA
0
184
Member Avatar for vallarakesh

this program is to find the largest palindrome of 3 digit numbers.this code is workig for two digit numbers but it is not working for 3 digit numbers. `` #include<stdio.h> #include<conio.h> #include<math.h> void main() { int i,j,con=0; long int num=0,res=0; clrscr(); for(i=999;i>900;i--) { for(j=999;j>i;j--) { num=(i*j); con=pal(num); if(con==0&&num>=res) res=num; } …

Member Avatar for 2teez
0
199
Member Avatar for monmondiesel

Hi, I am running Ubuntu 12 on Virtual box and I am using GCC to compile this simple C program that has simple OpenMp pragmas : #include <stdio.h> #include <omp.h> #define MAX 10000000000 void main() { unsigned long long i,j,k,l; int threadnumber; #pragma omp parallel shared(i,j,k,l) { threadnumber = omp_get_thread_num(); …

Member Avatar for Sokurenko
0
1K
Member Avatar for jesskavidja

Hey there, I'm having issues with a custom string tokenizer I'm using for an assignment. I've looked around and haven't managed to find anything that really answers my question, so here goes nothing. Whenever I run the program and it runs the tokenizer, I get a seg fault. I'm fairly …

Member Avatar for Sokurenko
0
285
Member Avatar for sparsh610

what is comparision of linklist? when i read this question , arises two option 1.either compare value of each element. 2.just compare the length of both the link list. pls help which one is right approach to solve the question.??

Member Avatar for deceptikon
0
70
Member Avatar for sparsh610

hello friends... **1**. struct node *p; p=malloc(sizeof(struct node)); **2**. struct node *p; p=malloc(sizeof(struct node *)); what is the difference between 1 and 2 code :) pls help

Member Avatar for mike_2000_17
0
81
Member Avatar for sparsh610

hello friends, i have some problem with the concept of singly link list,,, don't know how to read it backward pls help

Member Avatar for mike_2000_17
0
844
Member Avatar for Vish0203

hello!! i was working on a small software a few days back which allows a user to login through the interfaceand see the topics inside the program. But how toavoid mis use of it??? if a person gives the software to some one else giving his user name and password …

Member Avatar for Vish0203
0
73
Member Avatar for tubby123

Hey, Is there any difference between the 2 syntax, ie, str = "This is a test"; and strcpy(str,"This is a test"); I think, both of them, malloc some random 200 addresses, and give the starting location of the 200 chunk to the pointer variable 'ptr'. #include<stdio.h> char* str; int main(void) …

Member Avatar for Perry31
0
106
Member Avatar for silvesterphilip

*i like to study c programming from its basis to full., any website for c tutorial with simple and full contents? i search in google but no get a good site.*

Member Avatar for Lucaci Andrew
0
47
Member Avatar for shibu2all

void insertion_sort(int *a, int n) { int for(i=1;i<n;i++) { value=a[i]; for(j=i;j>0 && value<a[j-1];j--) a[j]=a[j-1]; a[j]=value; } } can anyone pls explain me the flow of this code... i am having confusion in understanding the flow..

Member Avatar for TrustyTony
0
226
Member Avatar for tubby123

Hey, Is there a way to know the contents at address 6295600(say) in C ? I don't want to do using a pointer, that is, something like printf("%d",*p); int a = 5; p = &a; and address of a = 6295600. I want to be able to do something like, …

Member Avatar for Ancient Dragon
0
55
Member Avatar for tubby123

How do I print out the address a pointer is holding. Currently I'm using the code pasted below. But I'm getting this error. Error: t.c:13:2: warning: format ‘%u’ expects argument of type ‘unsigned int’, but argument 2 has type ‘char *’ [-Wformat] Code: #include<stdio.h> #include<malloc.h> #include<string.h> #include<stdlib.h> char* str; int …

Member Avatar for Ancient Dragon
0
86
Member Avatar for shibu2all

void selection_sort (int *a, int n) { int i, j, m, t; for (i = 0; i < n; i++) { for (j = i, m = i; j < n; j++) { if (a[j] < a[m]) m = j; } t = a[i]; a[i] = a[m]; a[m] = t; …

Member Avatar for shibu2all
0
250
Member Avatar for ashish karna

**Bold Text Here* what is the code for performing mathematic calculation based on BODMAS rule in C*(such as 6+6/2=9) ,any suggestion ,plz??

Member Avatar for Sokurenko
-1
129
Member Avatar for sparsh610

hello friends, i have read a question about pointers and seems totally new concept for me .. how would you find out if one of the pointers in a linked list is corrupted or not? pointer is corrupted ??,, don't understand :( pls help your friend : sparsh

Member Avatar for mike_2000_17
0
166
Member Avatar for sparsh610

hello friends, i m doing programming in vc++. but while making a basic program of link list facing a problem. when i try to add aaloc.h file it turns into atlalloc.h. there is no file as alloc.h. #include <stdio.h> #include <atlalloc.h> struct node{ int data; struct node *link; }; void …

Member Avatar for Ancient Dragon
0
92
Member Avatar for sebass123

Hey I am trying to find a way for the user(not the programmer) to determine how many decimal places a number will print out to. I have tried pointers, precision mods and even a sub program to bypass my lack of knowledge in this area. Any help would be greatly …

Member Avatar for dheaven
0
185
Member Avatar for mohsin1992

#include<stdio.h> #include<string.h> void recurse(char [],const char *); int main() { char *charset="abcdefghij"; recurse("",charset); } void recurse(char str[],const char *charset) { int len; len=strlen(str); strcat(str,charset[len+1]); if(len<strlen(charset)) recurse(str,charset); printf("%s",str); } Like the question says, what is wrong here? This is the logic of my program 1. Keep a string called charset which …

Member Avatar for Trentacle
0
2K
Member Avatar for iAndrewMeyer

Am I freeing and declaring this 2d array correctly? int **ratings; ratings = (int**)malloc(sizeof(int *) * (numCouples*2)); for(i=0; i<numCouples*2*numCouples;i++) ratings[i] = (int*)malloc(sizeof(int) * numCouples); //Data is read into each array position for(i=0; i<numCouples*2;i++) for(j=0;j<numCouples;j++){ fscanf(ifp, "%d", &ratings[i][j]); //printf("%d",ratings[i][j]); } for(i=0;i<(numCouples*2);i++) free(ratings[i]); free(ratings); Thanks Drew

Member Avatar for Trentacle
0
139
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
429
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
310

The End.