19,876 Topics

Member Avatar for
Member Avatar for dakota5150

I have a label and text block on a WPF window and I'm trying to update those from a 2nd cs code file. I've tried the below code but the label is not getting updated...any help is greatly appreciated! [CODE] MainWindow main = new MainWindow(); main.statusLabel.Content = "Blah...blah"; main.statusTextBlock.Text = …

0
75
Member Avatar for Adami

I try to imitate the first stage of pre-processor, which is to remove comments from a *.c file. The main principle is that a *.c will be read and the program will create another file *.c1 which is an exact copy of *.c but without comments(c/c++ comments). Example(in Linux): >./myprog …

Member Avatar for Banfa
0
125
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
98
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
179
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
124
Member Avatar for Annettest

Hello all: I would be grateful for some basic advice about C++ error handling. From my reading, I understand that the "try, throw, catch" method is preferable to dealing with return values, which can be cryptic. But I'm not sure if I understand exactly how this works. I made a …

Member Avatar for Moschops
0
174
Member Avatar for ammarahmad001

I want a programme in c# in which , Delete phone numbers from csv file,if these phone no. exist in database Please helo me regarding this

Member Avatar for ddanbe
0
70
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
383
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
388
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
268
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
91
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
137
Member Avatar for Annettest

Hello all: I have read that the purpose of const member functions is to specify which functions may be used on const objects. This makes sense. An example is given in my text and I don't understand it. If anyone could help, I would be very grateful. Here is the …

Member Avatar for Annettest
0
220
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
730
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
76
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
242
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
38
Member Avatar for pseudorandom21

Hello, I thought I was doing things right when I created a delegate to call a function to access the container's data, but it still throws an exception. I have something similar to: [code] public ref class myform : public System::Windows::Forms::Form { private: System::Windows::Forms::ComboBox^ form_combobox; private: delegate String^ getItemDel();//<-- delegate …

Member Avatar for pseudorandom21
0
162
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
164
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
170
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
202
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
98
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
257
Member Avatar for aks_Truba

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

Member Avatar for griswolf
0
39
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
62
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
153
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
155
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
79
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
98
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
80
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
181
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
145
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
230
Member Avatar for BanKuZ

hi all, I have a class A that has a char* var, operator and methods. In addition I have a global func(char*s). I would like to run this code from the main function by adding operators to my class, I need help writing them. [CODE]A* pA; ... A** ppA = …

Member Avatar for BanKuZ
0
258
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
129
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
95
Member Avatar for cbsinc

I need some pay for play tutoring. I have a jammed schedule and don't want someone to do my work for me, but need direct and timely answers to questions, immediately. I don't have time to trial and error, or tough love learning. I take good notes, learn fast, and …

Member Avatar for Ancient Dragon
0
101
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
49
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
174
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
133
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
45
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
159
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
214
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
75
Member Avatar for devin1pm

First of all, Im not too good at c++. so please take it easy on me. I try to change the password but i only want to change a certain password in the text file.But when the text file got re-write like only one new password exits. the whole file …

Member Avatar for JSPMA1988
0
668
Member Avatar for pseudorandom21

Using C++/CLI-- Is there a good way to return a value (not a DialogResult) from a form shown as a dialog? I plan to use Invoke on a method to update the previous form from within the dialog, if not. I also would like to thank the fine members of …

Member Avatar for Ancient Dragon
0
337
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
176
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
237
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
108

The End.