19,876 Topics

Member Avatar for
Member Avatar for prince26121991

I just want to enter of 5 students data in structure but this loop is not running. pls help me out #include<stdio.h> #include<conio.h> #include<string.h> struct student { char name[20]; int age; float marks; } a[5]; main() { int i; clrscr(); for(i=0; i<5; i++) { printf("Enter the name of student"); gets(a[i].name); …

Member Avatar for prince26121991
0
121
Member Avatar for noahjonesnoah

Im curious if anyone knows if its possible to write a program to generate a regular expression given a finite automation. To make things less complicated I want to limit the number of states to about 4, assume the FA is in minimal form and that the FA has only …

Member Avatar for Gonbe
0
302
Member Avatar for PseudoGuard

In this part you will write a function to generate random numbers in a specified range. Specicially we want you to write a function named generateRandom that generates a single random number in a range specified by the user. The function takes two integer parameters representing the lower and upper …

Member Avatar for deceptikon
0
1K
Member Avatar for dontyoufeelmywrath

Mind guys if you could help me on creating this program(regards with file handling). starting with this: for instance. i have a .txt file that contains these: lexeme token main - Identifier ( - Open Parenthesis ) - Close Parenthesis { - Open Curly Bracket printf - Keyword ( - …

Member Avatar for deceptikon
0
143
Member Avatar for everphilski

long time listener, first time caller... I'm trying to generate Excel charts using c#. I'm using Excel.Range to set a range (series of values) to plot. However, I'd like to plot two series that are not next to each other. For example, B1:B10 and G1:G10 versus A1:A10 on the x-axis. …

Member Avatar for lokendra jain
0
1K
Member Avatar for glenndr_15

Greetings! Just want to ask how to create a C/C++ ide then link to a compiler? any advice? can I use a visual studio for creating an IDE?... Thanks Best regards, glenndr_15

Member Avatar for glenndr_15
0
353
Member Avatar for rithish

actually in infix or prefix expressions how does operators have high precdence than the other. for example + has high precedence than *.do they compare with ascii value of operator

Member Avatar for Gonbe
0
174
Member Avatar for ElDuderino12

#include <stdio.h> #include <stdlib.h> #define MAXSIZE 6 int main(int argc, char** argv) { float stddeviation, deviation, sumsqr, variance, mean, x, t, m, sum=0, max, min; int numdatapts, k; FILE * inFile; inFile = fopen("Uniform93.data", "r"); if(inFile == NULL){ printf("\nError opening file. Abort program.\n"); exit(1); } for (k = 1; k …

Member Avatar for Gonbe
0
1K
Member Avatar for songseungun

Hi. I'm having problems about my program. My program is something like a directory. It takes in values for different fields and stores it in a linked list in a sorted manner. It also allows the user to save the linked list contents to a text file. Everything runs okay …

Member Avatar for songseungun
0
871
Member Avatar for Grandiago

Hi. I'm new in programing and i have this program that i'm working on right now. it's still a working progress. but when i run it and choose from the options. the program kept moving upwards. like it looses the top part of the border. like this one: http://imageshack.us/photo/my-images/507/123sb.png/ this …

Member Avatar for Grandiago
0
157
Member Avatar for Dáni

helle there. I need a help in generate random 2D matrix !! How to write that plz !

Member Avatar for Ancient Dragon
0
238
Member Avatar for orar

#include <iostream> #include<string> #include<vector> using namespace std; struct Names { string fname; string lname; void output() { cout<<fname<<" "<<lname; } void input() { cin>>fname>>lname; } }; struct birth_info { int month; int day; int year; void input() { cin>>month>>day>>year; } void output() { cout<<month<<"/"<<day<<"/"<<year; } }; int main() { string …

Member Avatar for deceptikon
0
180
Member Avatar for rithish

hello iam trying a circular queue in linked list and array there are two questions for me 1.how can circular queue can be implemented in a normal linked list??i think it can be implemented in circular singly linked list right?? 2.if i implement it in array how i will connect …

Member Avatar for WaltP
0
141
Member Avatar for BoulderMen

I am trying to write a funtion to print the contents of a queue using ADT funtions. I composed the following code. It gives me a error of invalid type argument. Need help. int print_queue(QUEUE *queue) { int tempCount; int inputVal; while ((queue_count(queue)) != 0) { tempCount = queue_count(queue); queue_front(queue, …

Member Avatar for BoulderMen
0
160
Member Avatar for code_r

I'm trying to read from a text file and have any multiple whitespaces between characters become one whitespace. If this how I do it using an array, #include <stdio.h> //Function prototype void modifyspace(char *dest, char *src); int main() { /* Initialize an array of 2000 characters */ char src[2000] = …

Member Avatar for code_r
0
251
Member Avatar for hakibam

I modify this .cpp code into .c but it gives error: the original code is:(runs fine) [CODE]#include <string> #include <iostream> #include <stdlib.h> using namespace std; int main() { int c, s[10]; int i, j; string name; cout << "Welcome to Airline Reservations System!\n"; for (j=0; j<10; j++) { cout << …

Member Avatar for Abin Jossy
0
2K
Member Avatar for revelator

Hi friends, i am doing a basic menu based Car rental system in C. i have a doubt regarding switch... do C permit us to use multiple switch case? or a Case within a Case??

Member Avatar for revelator
0
205
Member Avatar for Dendei

Hello, so im trying to send an metod that takes a class as input parameter with a bunch of variables. I want to write in some textboxes in my php side of the program send them with my class and into a database. but the database part is no problem …

Member Avatar for Dendei
1
968
Member Avatar for semicolon
Member Avatar for nmaillet
0
231
Member Avatar for nitin1

#include<stdio.h> #define num 10000000 int a[10000009]={0}; void sieve() { int i,j; for(i=2;i<=3164;i++) //loop till sqrt of largest number 10^7 { if(a[i]==0) // all primes are marked 0 { for(j=i*i;j<=num;j+=i) { if(a[j]==0) a[j]=i; // if i is prime then all it's multiples pos have value of i } } } return; …

Member Avatar for TrustyTony
0
219
Member Avatar for nitin1

here is a DP problem which i am solving from 2 days now. and i am finding a damn difficult. can you please tell what is overlaaping subproblem and what is optimal substructure in this problem. then i will try it again. any help will be appreciated. thanks http://www.spoj.pl/problems/GNYR09F/ thanks

Member Avatar for Gonbe
0
176
Member Avatar for Petranilla

Hi Everyone, Im' new in C. I was tasked to do a word game. Its a Guess a word game. The user inputs the letter through arrow keys. Then, my program supposed to check if each letter is correct. Then, display it in boxes. The problem is I cannot validate …

Member Avatar for Petranilla
0
246
Member Avatar for Petranilla

I'm a novice in C. I would like to ask the ff: 1. what is the return value of strstr function? 2. Is there a substring function in Turbo C where you specify the string, the length of string to extract and the starting position? 3. For instance, I have …

Member Avatar for WaltP
0
169
Member Avatar for hyung101

hmm..i'm doing something like a simple registration.. the user will input the information being asked, then those info will be stored into an array..are spaces not allowed to be stored in an array..? well, i can't explain the problem that much.. here's my simple code: #include <stdio.h> int i; char …

Member Avatar for WaltP
0
308
Member Avatar for salakgocap

Hi, Just wondering if anyone have a good source to read about getting an input from a file. for example: rather typing on the command prompt, i prefer to store all my command on .txt file. and using a single command to read what inside the .txt file and run …

Member Avatar for WaltP
0
160
Member Avatar for semicolon

C#, SQL SERVER 2005 first. Sorry for the bad english :> can anyone give me ideas, techniques, theories, or any posible solution. Here is a scenario i have a form called SearchItem and a database table doc_Item doc_Item has a 1 million. . . data. when i click a button …

0
60
Member Avatar for straylight

I am attempting to reverse a string for a homework assignment and then reverse each word in the string. The trick is we are suppose to code it without using functions. Like "I like cats" should be 1st "stac ekil I" and then "cats like I". Here is what I …

Member Avatar for rithish
0
1K
Member Avatar for Brigadier

Hi Everyone, I have been stumped by this problem. I need to create a pattern such as: 1 21 221 2221 22221 Using nested for loops. I have something that does (A) 222221 222221 222221 222221 222221 and used to have something that did (B) 1 21 221 2221 22221 …

Member Avatar for Adak
0
117
Member Avatar for valenluis
Member Avatar for L7Sqr
0
35
Member Avatar for prakhs

#include <stdio.h> #include <malloc.h> struct node { int data; struct node *link; }; void append (int data, struct node **s) { struct node *p, *q; if (*s == NULL) { p = (struct node *) malloc (sizeof (struct node)); p->data = data; p->link = NULL; *s = p; return; } …

Member Avatar for deceptikon
0
146
Member Avatar for jnewman3

I've been working on this code for 2 days now and i finally think i got the while loop running correctly but now i cant seem to print the child process id's. The code starts with the parent process forking 3 child processes. Then the parent must wait till a …

Member Avatar for rubberman
0
276
Member Avatar for Some Dude

So basically I am new to API programming and teaching myself. I've done a bit of console C++ that I got off of.... an internet tutorial. The story is the same here too. I am somewhat aware of what the lines of code do, though I am not yet a …

Member Avatar for neithan
0
314
Member Avatar for paul9519

hi everyone i have a problem with this code below. when i try to read all the files in a directory i can but when i try to put them in a vector, it doesn't work, all the elements in the vector become the last element added. I'm not sure …

Member Avatar for Tumlee
0
215
Member Avatar for dev.bardoliya.5
Member Avatar for Androw

Hello i managed to call my C# DLL in Lisp with (command "Program.dll") and I m able to call Lisp from C# with sendstring ... What I need is a Lisp Function that called from C# which gives its results (picked Objects) back to C# Has anybody an idea ? …

0
47
Member Avatar for brahle

Always use scanf() and printf(). They are much, much faster than cin and cout. Also use stl algorithms, like sort, reverse and find, especialy if they are member functions of a container class you use.

Member Avatar for neithan
0
2K
Member Avatar for rithish

hello can any one give a easiest and understandble link or video tutorial for cursor implementation of linked list very hard to understand please suggest a good link and understandable

Member Avatar for rithish
0
3K
Member Avatar for rithish
Member Avatar for deceptikon

Provided below is a bare bones dynamic array library. The game is to extend this library with new primitives and features that interest you, that you've needed in the past, or that you feel may be useful. The intention of this game is to give some of the newer folks …

Member Avatar for myk45
0
251
Member Avatar for suhrud.l

For an array of n int variables, When does binary search perform better than ternary search?? Also, reverse case, ie when does ternary search perform better than binary search? Why is binary search a more preferred method of searching for integers entered in an array??

Member Avatar for c1c2c3c4c
0
245
Member Avatar for rebelstar

Hello, i am facing some problem with a memcpy. I have a struct. lets us say struct { unsigned in[6] ; //32 bytes in all }strb; struct { // FIRST HALF unsigned int a; char b[1020]; .. .. //LAST ENTRY strb a[512]; //512* 32 = 16384 bytes }A; Now, ihave …

Member Avatar for dx9_programmer
0
175
Member Avatar for somjit{}

read [here](http://crasseux.com/books/ctutorial/getline.html) that fgets() is bad, although no explanation given... also i think the default getline() isnt in C , is it?? **why is fgets() bad??** also, the page on getline says it takes in char** as the 1st input type... whats a '**'? why is it used?? i couldnt …

Member Avatar for somjit{}
0
536
Member Avatar for nitin1

#include <stdio.h> #include <math.h> int main(void) { int number; double result; printf ("\n Introduce an integer: "); scanf ("%i", &number); result= sqrt (number); if ((result * result)== number) printf ("\n The integer HAS a perfect square \n\n"); else printf ("\n The integer DOES NOT HAVE a perfect square \n\n"); } …

Member Avatar for somjit{}
0
174
Member Avatar for moozy

Hi I am developing a windows application. For your infomation FRONT END : C# (VISUAL STUDIO 2008) BACKEND : SQL SERVER 2008 In a single form I have an option for add and remove client. Two different buttons are used(Add and delete clients). When I click on Add button the …

Member Avatar for dualzNZ
0
90
Member Avatar for smith32

Hi, I'm working on a quick sort for double linked list. All work except the first item. I don't know what is wrong. Can u plz help me find the error? Here is my code. dlist_t* quick_sort(dlist_t* list) { dlnode_t *tnode = NULL, *first = NULL, *last = NULL; first …

Member Avatar for smith32
0
246
Member Avatar for zychos

I am getting the following errors when i gcc my code: 44) unixs1 $ gcc whoisserver.c whoisserver.c: In function `main': whoisserver.c:59: warning: passing arg 2 of `bind' from incompatible pointer type whoisserver.c:71: warning: passing arg 2 of `accept' from incompatible pointer type Undefined first referenced symbol in file bind /var/tmp//ccSx8OhK.o …

Member Avatar for zychos
0
192
Member Avatar for noahjonesnoah

Hi all, I have a question about comparing the contents of characters in arrays to see if they are the same. When I try and do something like this: char output_1[5]; char output_2[5]; int i; for (i = 0; i < 5; i++) { if (table_1[i][0] == table_x1[i]) { output_1[i] …

Member Avatar for noahjonesnoah
0
135
Member Avatar for nitin1

actually , I am working on a project and i need to sort the co-ordinates in the increasing y value. input: 1 2 3 4 5 6 6 6 7 8 4 5 like this, and i need to sort them in the increasing y value. my approach: i think …

Member Avatar for nitin1
0
116
Member Avatar for shanki himanshu

Since in XOR linked list current pointer store the XOR of addresses of previous and next node. my question is how do we XOR two pointers?

Member Avatar for deceptikon
0
140
Member Avatar for ashdeekon

Hi I have the program for inserion of keys into the B tree and displaying them.But i want to write a code for the b tree in C so that each key in the B tree should have 4 attributes. I'm having trouble modifying the structure pointers in the program …

Member Avatar for deceptikon
0
151

The End.