15,551 Topics

Member Avatar for
Member Avatar for sudipan007

the following program displays the pth prime number.....but the program is not working ......plz help [CODE]#include<stdio.h> #include<conio.h> void main() { long int a=0,n=0,i=2,j , p ; printf("insert the number") ; scanf("%ld",&p); while(n!= p-1) { for(j=2 ; j<=i-1 ; j++) { if(i%j == 0) { a==1 ; break ; } } …

Member Avatar for WaltP
0
95
Member Avatar for BLUEC0RE

My program has a function that reads in information until it hits a designated character, takes the text just before that character, does something with it, and then comes back for more text starting at that designated character. So... Special character is: 'z' Text file: "This is a lot of …

Member Avatar for WaltP
0
176
Member Avatar for yen chin

Hi, I'm yen. Recently, I am doing my thesis project on the topic of Genetic Algorithm with Integer representation. Anyone can help me to write a simple program to solve the Travelling Salesman Problem by using Genetic Algorithm which is in integer representation? The task is to find the shortest …

Member Avatar for jonsca
0
122
Member Avatar for lochnessmonster

want user to input an integer value...the integer value is then converted to an ascii string....the ascii string is then passed into isValidNum(num); and it should return 1 if the number is valid and 0 if number is invalid. for some reason it keeps returning 1 no matter what value …

Member Avatar for WaltP
0
381
Member Avatar for ram619

In this code compiler says "type mismatch" in function. There are two diff data type in function one int and one Float. Is it possible to use two diff values or i need to take both of same type. plz rply Thanks [code=c] #include<stdio.h> #include<conio.h> void main() { int a; …

Member Avatar for lisaroy1
0
384
Member Avatar for vienne

[B]I'm having a problem with my sorting algorithm. before I made quick sort which used insertion sort, but I don't want to use this insertion sort. I want to use recursive algorithm. Also, I want to get new idea, so If you know any quick sort algorithm, reply for me.Please~ …

Member Avatar for shashankc
0
264
Member Avatar for tiuwulf

Hi there, i've ran in a problem and made up an example code of my prob. [CODE]#include <stdio.h> #include <stdlib.h> #include <string.h> typedef struct mystruct { int a; }mytype; mytype* createMytype(int x) { mytype *mt; mt = (mytype*)calloc(1, sizeof(mytype)); mt->a = x; return mt; } int foo(mytype* mt) { mt …

Member Avatar for tiuwulf
0
89
Member Avatar for harikrishna439

I have a problem with me.I'm unable to understand it.So I want from you the meaning and explanation of that problem below.I don't want program from you. ---------------------- A rectangle with sides parallel to the X- and Y-axes is specified by four real numbers a, b, c, and d. Assume …

Member Avatar for himam
0
134
Member Avatar for Dionysus

hi I was wondering if anyone knows how to create a dictionary using ANSI C. I really Dont know where to start...any help is appreciated... Thanx in advance

Member Avatar for Adak
0
727
Member Avatar for ram619

At line 12 compiler gives error....`float*' to `float' for argument `6' to `int fun(int, int, int, int, int, float, float)' could anyone plz tell me, where i m wrong......... Thanks [code=c]#include<stdio.h> #include<conio.h> int fun(int,int,int,int,int,float,float); int main() { int a1,a2,a3,a4,a5; float avg=0.0,sum=0.0; printf("Enter the five values"); scanf("%d %d %d %d %d",&a1,&a2,&a3,&a4,&a5); …

Member Avatar for ram619
0
5K
Member Avatar for jk09

what is meant by infinite time complexity??? i mean, does it imply that the problem cannot be solved by the algorithm as it takes infinite time..??:?:

Member Avatar for Narue
0
73
Member Avatar for Annettest

Hello all: I would be very grateful if someone could help me to understand header and definitions files. A colleague told me that definitions should never be included in a header file, but I also read that template and inline functions should be included. Is this true? If so, is …

Member Avatar for thelamb
0
238
Member Avatar for tsunami123

I have a programming problem: 1*enter a string up to 10 letters 2*enter a number of players 3* enter a n lines based on prvious input with name of player and string with 7 characters for every name based on the input calculate 4*if all letters of player appear in …

Member Avatar for tsunami123
-1
35
Member Avatar for .It.

Hi all, how could you initialize, through a loop, a c array? For instance, say I have [CODE] #define SIZE 10 int test[SIZE]; for (unsigned int i = 0; i < SIZE; i++) { test[i] = 0; } [/CODE] How can I make use of some Assembly to loop through …

Member Avatar for .It.
0
162
Member Avatar for atticusr5

Hello all, So I have been trying to "redo" a c++ program in c and I am getting stuck on strings (I dont code in c never have still learning). Any who in my C++ program, I use string concationation tools to print out select output, however c does not …

Member Avatar for atticusr5
0
165
Member Avatar for darknoobie

Hello forum. I'm new to c programming. I have been reading source files from my smt32 firmware and I came across this code. In one of my books I read that you can have macro functions. Is this function testing whether I2C1 and I2C2 is enabled? [CODE]#define IS_I2C_ALL_PERIPH(PERIPH) (((PERIPH) == …

Member Avatar for darknoobie
0
200
Member Avatar for tushar_veer

Hi freinds, How we can do a graphics under window program as like draw a different shapes,as like Circle,REctangle etc.

Member Avatar for asma akram
0
94
Member Avatar for Hey90

I have to create a database with the data stored in a .txt file. Each record is for a company with the following fields: Name, Place, East(km), North(km). Each record from the file needs to be read into a struct array. I have managed to read the records into a …

Member Avatar for Adak
0
251
Member Avatar for aks_Truba

#define FILENAME(extension) test_##extension, how will it print FILENAME(back)

Member Avatar for griswolf
0
37
Member Avatar for inilahs

Hello all ! am doin a project in data mining field. A part of it is to implement apriori algorithm in documents. in the algo the first step is to remove the stop words in the documents and then to find the frequent itemsets.. i ve implemented till this.. now …

0
60
Member Avatar for lochnessmonster

i have a question about casting for pointers! int *pointer = 30000; store address 30000 into pointer int *pointer2 = pointer; // store address 30000 into pointer2 the above 2 statements are equivalent to.... int *pointer = (int*)30000; is this statement correct? if not whats the difference! thx

Member Avatar for Trentacle
0
149
Member Avatar for fka

Hi. I have a troubble with reading string from file and saving it in a structure. Here's my code: [CODE] FILE*t; t=fopen("file.txt", "r"); wt=(pointer)malloc(sizeof(list)); w=wt; for(i=0; i<3; ++i) { w=(pointer)malloc(sizeof(list)); fscanf(t, "%d", &w->id_t); fscanf(t, "%s", &w->name); fscanf(t, "%f", &w->price); fscanf(t, "%d", &w->tax); printf("%d\n", w->name); //for check w->next=NULL; fscanf(t, "%c", &c); …

Member Avatar for WaltP
0
153
Member Avatar for ram619

When i am trying to run a C program in Eclipse, it gives error. Saying, "launch failed, Binary Not found" Could anyone plz tell me how to put in Binaries into Eclipse........

Member Avatar for jonsca
0
76
Member Avatar for moroccanplaya

the problem that i have is when i ever create a file the Linux operating system sets the the permissions automatically so how do i remove the permissions within the program ?

Member Avatar for taylorg
0
95
Member Avatar for lochnessmonster

if i were to do this in a program, would it possibly overwrite data/memory that is already being using by my application? int main() { char *pointer = "hi"; pointer = "weeeeeeeeeeeeeeeeeeeeeee"; return 0; }

Member Avatar for taylorg
0
77
Member Avatar for swapnil15

I am using Fedora 14 since last month , i tried to use do C coding on it but unfortunately compilation command is not working in it although GCC is installed on it. Need some help!

Member Avatar for anirudh33
0
175
Member Avatar for aimbo

Hello, I'm having some troubles working with strtok. I'm having a string of numbers I want to put in an array, and say from the list I want to get an array with 1,3,5,6,7,8,9,10,12,13,14. First I just wanted to see the single numbers in one place and split that 5-9 …

Member Avatar for Adak
0
143
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 gerard4143
0
225
Member Avatar for pooran.c

guys help me in implementing "doubly linked list and circular linked lisct in c" . I know the logic but i am finding difficult to code.

Member Avatar for Ezzaral
0
127
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

The End.