15,551 Topics
| |
My Ubuntu version is 12.04. I'm simply trying to include GL/glu.h in my program, but I get the error: `fatal error: GL/glu.h: No such file or directory` I include it like this: `#include <GL/glu.h>` I have libgl1-mesa-glx-dbg, libgl1-mesa-dev, mesa-common-dev all installed. | |
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 | |
To Check Wether the 3 Points are Collinear or Not. | |
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 … | |
Wether Given three sides a,b,c Form a Triangle or Not | |
To Find the Prime Factors of Given Number | |
To Check Whether the Given Point P is inside a Triangle or Not.. | |
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, … | |
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; } … | |
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(); … | |
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 … | |
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.?? | |
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 | |
hello friends, i have some problem with the concept of singly link list,,, don't know how to read it backward pls help | |
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 … | |
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) … | |
*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.* | |
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.. | |
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, … | |
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 … | |
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; … | |
**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?? | |
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 | |
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 … | |
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 … | |
#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 … | |
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 | |
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 … | |
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" ); … | |
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 … |
The End.