15,552 Topics

Member Avatar for
Member Avatar for dip7

Hi, I am have written a program in C but using Dev-C++ to run it. I have compiled my source code in c. however, my output window does not stay. I tried adding system(“PAUSE”); before return 0, but it does not work. My program has both return 1 and return …

Member Avatar for Ancient Dragon
0
93
Member Avatar for abhijit (EEE)

I have made a line follower robot. now i want add an another property to that robot. my line follower followes a black line. i have used ir sensor and atmega 8 microcontroller. i have done it with embedded c. it worked properly. now i have made 4 white marks …

0
46
Member Avatar for MichaelSammels

Does anyone know how to read the contents of a binary file into a static struct array, that can then be searched like a normal array?

Member Avatar for Adak
0
172
Member Avatar for TomaCukor

hello my question would be if som1 can help out with a better prototype than i have for verifying if input is within ascii alphabetic range what i have now [CODE]int betu (char s[]){ int i, jo=0; for(i=0;i<strlen(s);++i) { if(!isalpha (s[i]) && s[i]!=' ' ) return 0; else ++jo; } …

Member Avatar for WaltP
0
130
Member Avatar for abhijit (EEE)

I have been working with a atmega8 micro controller. I am a beginer in embedded c. I have already wrote programs like line follower, obstacle avoider etc. and they all worked properly. So, now i want to drive a servo motor with my ATMEGA8. for that PWM should be generated, …

0
43
Member Avatar for vineeshvs

[code] #include <stdio.h> #include<stdlib.h> int **matrix_mul(int **m1,int **m,int a,int b,int c,int d); main() { int i,j,r1,r2,c1,c2,**p,**q; printf("Enter the number of rows and columns of first matrix :\t"); scanf("%d%d",&r1,&c1); printf("Enter the number of rows and columns of second matrix :\t"); scanf("%d%d",&r2,&c2); //memory allocation for m1 int **m1; m1 = malloc(r1 * …

Member Avatar for vineeshvs
0
156
Member Avatar for iwanttolearnc

im trying my hand at reading data via serial communications on a windows 32bit computer. ive accomplished this, extremely crudely and have to some degree been successful. the device i am trying to read sends data in the format $A.B.C$ followed by a '\n' or newline. using the code written …

Member Avatar for Adak
0
205
Member Avatar for hitler1331

I'm running ubuntu on x86_32...and I keep getting segmentation fault while running this program. [CODE] #include<stdio.h> #include<stddef.h> char *memcp(char *dest, const char *src, size_t n) { char *dp = dest; const char *sp = src; while(n--) *dp++ = *sp++; return dest; } int main() { char *s = "abcde"; char …

Member Avatar for Ancient Dragon
0
72
Member Avatar for Joey_Brown

Hello So I have a simple structure : [CODE] struct students { char name[30]; unsigned int noofcourses; char course[50]; char status[30]; }arr[50]; //50 students [/CODE] I would like to know is how could I read multiple courses in per student from memory.[CODE]Example: Joey Brown 4 Math$Chem$Phy$Cooking Enrolled m8!! [/CODE] So …

Member Avatar for Adak
0
170
Member Avatar for tacker

I'm writing a simulation in population genetics and am having a problem setting up the initial population. The problem boils down to this... [CODE]int test[1][1][1]; test[0][0][1]=1; test[1][0][0]=2; printf("test: %d\n",test[0][0][1]);[/CODE] Why does this print 2? I feel like it should print 1. I've searched forums for an answer, but haven't been …

Member Avatar for tacker
0
227
Member Avatar for steve_27

Basically, I need to program something using STACK, backtracking to make all the possible sum, of "n" numbers. Example. If a user input 5. n = 5 1: 1 1 1 1 1 2: 1 1 1 2 3: 1 1 3 4: 1 2 2 5: 1 4 6: …

Member Avatar for Adak
0
104
Member Avatar for lochnessmonster

pretty much here is a rough outline of what i have done [CODE]struct monster { int health; int armor; monster *nextaddr; }; int main() { int num; monster *pointer; printf("how many monsters do u want"); sscanf(%d, &num); pointer = (monster*)malloc(num * sizeof(monster)); //Here i need some kind of LOOP to …

Member Avatar for gerard4143
0
101
Member Avatar for tudorH

Hi I am totally new to C programming (been using java for about 1 year) and have a question about pointers/linkedLists. So what i am trying to do is create a linked list and insert a new node as the head of the list...below is my code: The error I …

Member Avatar for tudorH
0
227
Member Avatar for pooran.c
Member Avatar for pooran.c
0
119
Member Avatar for prasi_raj

Hi everyone, I am not getting how to enter values to that array. Please some one give me a solution. typedef struct user { int array[10]; }user; void main() { int i; user *tmp; printf("enter array values"); for(i=0;i<10;i++) { scanf("%d",&tmp->array[i]); } for(i=0;i<10;i++) { printf("[%d]\n",tmp->array[i]); } }

Member Avatar for Rass Saee
0
84
Member Avatar for lisaroy1

I have the basic knowledge of C Programming i have learned till Command line Argument programms and now i need the knowledge regarding the database connectivity.So,can anyone help me with the same.

Member Avatar for Adak
0
81
Member Avatar for bleedi

Hi, I was programming with POSIX threads and I was using semaphores. All of a sudden the program didn't work anymore, and I started searching for the problem. It turns out that my first semaphore command "sem_open()" causes the problem. It returns value "0", or "SEM_FAILED", and sets errno to …

Member Avatar for bleedi
0
132
Member Avatar for roydavies20

Just Started C in University, first time doing it and the first program i had to write was one that required someone to be able to enter 5 random numbers and get the average of the 5 numbers, the highest/lowest of the 5 numbers and then finally the standard deviation …

Member Avatar for roydavies20
0
237
Member Avatar for efronefron

I have been racking my brains to find what's wrong with my code... been playing with it for an hour or so but it seems to still be wrong.. Please anyone can point out the mistake? Im so frustated right now.:yawn: the answer to the question is 21124, but this …

Member Avatar for efronefron
0
598
Member Avatar for anirudhruia

[CODE]#include<stdio.h> void string_copy(char str1[],char str2[]); int main() { int i; char str1[10],str2[10]; printf("please enter a name(string 1):"); gets(str1); printf("please enter a name(string 2):"); gets(str2); string_copy(str1,str2); printf("string 2 copied to string 1"); for(i=0;i<10;i++) { printf("%c",str1[i]); } return 0; } void string_copy(char *p1,char *p2) { int i; while((*p2)!='\0') { for(i=0;i<10;i++) { *(p1)=*(p2); …

Member Avatar for WaltP
0
162
Member Avatar for vineeshvs

[CODE] #include<stdio.h> #include<stdlib.h> int **transpose(int **x,int m,int n); main() { int nrows=2,ncolumns=2,i,j,k=0; //memory allocation for array x int **array; array = malloc(nrows * sizeof(int *)); if(array == NULL) { printf("out of memory\n"); return 0; } for(i = 0; i < nrows; i++) { array[i] = malloc(ncolumns * sizeof(int)); if(array[i] == …

Member Avatar for vineeshvs
0
346
Member Avatar for mikecolistro

Hi i'm in a university class, and i'm working on a little assignment that is supposed to have an int array and have assorted functions to do things to the array currently i have two of the four functions working and i'm having trouble with the function that is supposed …

Member Avatar for ravenous
0
166
Member Avatar for iwanttolearnc

im trying my hand at calling c functions from python. im reading up the tutorial [URL="http://csl.sublevel3.org/C-functions-from-Python/"]http://csl.sublevel3.org/C-functions-from-Python/[/URL]. however part of the tutorial says that i should [QUOTE]Compiling dynamic libraries on Mac OS X is different from the usual gcc -shared you might be used to: gcc -dynamiclib -I/usr/include/python2.3/ -lpython2.3 -o myModule.dylib …

Member Avatar for iwanttolearnc
0
231
Member Avatar for wballinger

I'm using microsoft visual studio 2010 express edition, and am trying to install a new library (pdcurses). I have all of the header files in the correct folder, and the library correctly includes. However, if I use any functions from the library, I get linker errors about "unresolved externals". Do …

Member Avatar for Ancient Dragon
0
97
Member Avatar for DJSAN10

Why is float called single precision floating point and double as double precision floating point?

Member Avatar for Ancient Dragon
0
134
Member Avatar for moroccanplaya

i have this to check for numeric inputs, which returns then menu if a number is entered less or grater than 5 but how would you do this with alphabets ? for any alphabet or any other charterer apart from numbers should return the menu [CODE] while (select < 1 …

Member Avatar for TomaCukor
0
91
Member Avatar for DJSAN10
Member Avatar for salvador01

hi! i'm beginning to like C, i find it very challenging. and i have this problem, that confuses me here: Construct a C that will accept 5 digit number, determined the reversed number and display the message "equal" if the original 5 digit number and the reversed number is equal, …

Member Avatar for jonsca
0
106
Member Avatar for thilinam
Member Avatar for EMT

I have created a dll and I want to use its functions in my other projects using Visual Studio 2008.Kindly Help...:icon_sad:

Member Avatar for EMT
0
144

The End.