18,491 Topics

Member Avatar for
Member Avatar for Dabdob

Hi guys… I want to write small program in C printing three or more people in array..how? please write to me the syntax as I am very poor in C.. How to define the name? and accept the conformation from the user? Either by yes or no The printing should …

Member Avatar for server_crash
0
145
Member Avatar for Micko

Hello friends, I just want to say that last week a got a job. Since I'm electrical engineer I got job in nearby Thermal power plant. Now, I don't have spare time anymore as I used to have, and I guess it's time to quit my hobbies. Sometimes I'll be …

Member Avatar for vegaseat
0
178
Member Avatar for nabil1983

Trying to understand how to do this Q. Can some explain using O-notation, how would i analyse the efficiency of the two algorithms below. ? Assuming that the critical operation is compute and size is the size of the array. 1) compute(a[1]) + compute(a[2]) + compute(a[3]) + compute(a[size]) 2) for …

Member Avatar for nabil1983
0
117
Member Avatar for comwizz

I am having this problem with precedence of operators. Its with the increment and decrement operators. [code] int i,j=1; i=(j++)+(++j)+(j++); [/code] this evaluates to 6 instead of 7 . Why does this happen. It would be of great help to me. Thanks, comwizz

Member Avatar for Rashakil Fol
0
190
Member Avatar for TimC

what I am trying to do is retrive the "status" back to my main prog of the status of a patient. I thought it was a simple case of S.retrieve(index of person I was looking for) and I would recive the status (which is an integer) back to my main …

Member Avatar for TimC
0
109
Member Avatar for emailsrs

I have used arrays in the program; a[3] - now i want to change the program to dynamic array value If I enter more than allocated(3) characters in the input - it throws error and the program stops running error "Segmentation fault" (i am running c on unix) - i …

Member Avatar for SpS
0
127
Member Avatar for TimC

Below I have attached 4 methods from my linked list class. 1) find 2)remove 3)retrieve 4) Insert. what I'm trying to do is write code that will let me MOVE the position of a node to another position in the linked list. Anyone got a clue?? regards Tim [code]SeqItemType Sequence::retrieve(int …

Member Avatar for TimC
0
156
Member Avatar for Dabdob

Hi guys,, i want to have C to my PC..i am using win XP. anyone can help me please

Member Avatar for perniciosus
0
207
Member Avatar for ferrant

Hi, I have difficulty declaring a hash_set. I would like a hash set where the key is a structure Point3d (typedef Point3D {short x,y,z}) and the value in the set associated with the key an int. I don't quite understand how to declare it ... something like hash_set< const Point3D, …

Member Avatar for perniciosus
0
170
Member Avatar for atrusmre

So I'm writing a program (MFC) that connects to a server w/ windows sockets (YUCK I know). I left it running as part of an endurance test the other day, and my PC ran out of virtual memory. Odd eh? So I ran it again using task manager and noted …

Member Avatar for perniciosus
0
548
Member Avatar for willseyvilleny

i need to finish this program by friday at 8:00am i know im new but i have a lot of work done so pretty much here is what i have. requirements programmer defined function for into - check user must input element statistics into element_t im pretty sure i made …

Member Avatar for tayspen
0
109
Member Avatar for nabil1983

Hello Im trying to understand and explain how the quick sort code actually works, i unable to understand or xplain line 4 to 11. Can ne of u xplain to me briefly what those lines actually do in the code algorithm.... Apreciate ne help. [CODE]do { while(strcmp(array[i].Genre,x)<0 && i<right) i++; …

Member Avatar for perniciosus
0
131
Member Avatar for desertstorm

Hi: I had a question on how to use: int Read(char *buffer, int size, OpenFileId id); void Write(char *buffer, int size, OpenFileId id); This is for a client that is connected to a network host server and it is for a chatting program. If someone could direct me to a …

Member Avatar for jim mcnamara
0
145
Member Avatar for desertstorm

How's it going: How do you use fopen() to establish a stream to console I/O (keyboard)? What I needed to do is read in data from the console I/O and then send it elsewhere using fputs. I just don't know what the first argument for fopen("here", r) would be. Oh, …

Member Avatar for Ancient Dragon
0
327
Member Avatar for nabil1983

Hello Can someone tell me what this sort algorithm is called.? And if possible a little bit of information about it... [CODE]void record_search(struct CdRecords cdDB[]) { system("CLS"); int i; char name[20]; printf("Enter Name:"); scanf("%s", name); for(i = 0;i<datasize;i++) { if((strcmp(name,cdDB[i].Artist))==0) { ENTER DATA TO BE DISPLAYED } } printf("Press Enter …

Member Avatar for SpS
0
195
Member Avatar for Mistro116

Hello, I get the following seg fault error when I try to delete the last node of the list. Does anyone know why? My delete function and high level function are included below: The seg fault only occurs when the if value in BeginQuizFirstTry detecting that CheckAnswer is not true …

Member Avatar for Mistro116
0
122
Member Avatar for C++ programer

Dear all; i have a problem with functios. i have a program to write using struct in functions with arrays also. i have the program written in structes with array but not using the functions and i don't no who the do it with functions. if anybody acn help i …

Member Avatar for jim mcnamara
0
151
Member Avatar for nabil1983

i got the quicksort coding correct ,, the problem is that the data is still not sorting below is the complete program to the database. The data is to be sorted by genre like i have stated i have checked over and over again but cant find nething wrong... The …

Member Avatar for nabil1983
0
199
Member Avatar for Naveena

Can anybody write a small program that will compile in C but not C++ Pls. reply me if any body knows the answer.

Member Avatar for SpS
0
145
Member Avatar for free_eagle

Hello im practicing C language and i ran into this code and i can't figure out the outputs :( can u help me please ? I'm confused in operator precedence. and What does [I]short circuit evaluation[/I] means in c? when i run this code the output is: 000 and 001 …

Member Avatar for free_eagle
0
187
Member Avatar for desertstorm

Does anybody know of any sites that give a good tutorial on how to implement a chat client (console client(allows you to type in messages on the command line) and network proxy client(allows programs to connect via network sockets)) for interactions with a blackboard. Like sockets, fgets, filedescriptors...etc. The blackboard …

Member Avatar for desertstorm
0
177
Member Avatar for Valmian

Hello all, When calculating sin(M_PI) the computer outputs ~-3e-7. Unfortunately, in my program the error grows (it is multiplied by a number on the order of 1e10) into around -208. My question: is there a way to round a float/double to only 3 digits after the decimal point (I do …

Member Avatar for dwks
0
368
Member Avatar for new guy n c++

Hi i am new guy in programing and i need ur help in this program if u can. my problem is that we have to write a program to read a file usinag a struct array and a function and the assigment is Print all of the input data ; …

Member Avatar for Ancient Dragon
0
184
Member Avatar for nabil1983

Hey after spending a few hours trying to understand why my quick sort is not owrking, i've tried calling the q_sort() and quick_sort() but with no luck...... below is how i had it from the start for less confusion,, can someone tell me why it isnt working... i've checked the …

Member Avatar for dwks
0
194
Member Avatar for Naveena
Member Avatar for ehab_aziz2001

Hi, I runned that program with int variables and was OK but when I changed the type of pay_calc(),*emp_rate,pay from integer to float I failed ..Please Help main() { int *emp_no,*emp_works; int pay_calc(),*emp_rate,pay; char *emp_unit,ans,another(); system("cls"); do { input(&emp_no,&emp_works,&emp_rate,&emp_unit); pay=pay_calc(emp_works,emp_rate,emp_unit); pay_slip(emp_no,emp_works,emp_rate,emp_unit); cash(pay); } while (another()=='y'); return 0; } char another() …

Member Avatar for dwks
0
123
Member Avatar for akki_freak

Hi guys... consider this... int a[10][3]; will give us a two dimensional array. Now can we do the same thing using malloc at run time?? Think.... :D

Member Avatar for dwks
0
245
Member Avatar for nabil1983

This program is almost the same as the one last i posted but here the bubble sort algorithm is not working, i get a compiler error saying:: size of cdRecords is not known and need explicit cast to convert I cant work out what the problem is because another program …

Member Avatar for nabil1983
1
235
Member Avatar for akshayabc

Plz answer to my C doubts:- 1) Why do prototypes of some predefined functions in ctype.h(ex- tolower(ch)) has 'int' as the data type for formal arguments? How will it matter if the formal arguments r of type 'char'? 2) Is there any command in DOS for viewing the non printable …

Member Avatar for Ancient Dragon
0
357
Member Avatar for desertstorm

I challenge anyone to code this in C language: function read_next_data(fd) data = read_async( fd ) if len(data) == 0 => Nothing to read, register to be called back when something is ready event_polling_register( fd, read_next_data ) => Go back to doing something else else => Data was available and …

Member Avatar for Ancient Dragon
0
125
Member Avatar for nabil1983

I got everything working, a couple of probls with file write. But ill work it out. I just need help on getting the quick sort working here...i got it written and even in my switch statement but for some reason it dont work....ne one know y...?? [CODE]//(Database Management System(DBMS), user …

Member Avatar for nabil1983
0
495
Member Avatar for LordJayno

I'm trying to create a graph class that is implemented as an array of pointers. This array is dynamically allocated which is where i'm having my trouble. I'm getting an error message from my equal signs saying that the operator doesn't exist [CODE]GraphClass::~GraphClass() { Node *temp; temp = array; Node …

Member Avatar for Rashakil Fol
0
185
Member Avatar for Amoris692001

I was looking for a tutorial on how to create files. I'm real new to C programming. I have to create a program which uses two files for input. I just need the create the files and then I can hammer out the rest. I know how to access the …

Member Avatar for Ancient Dragon
0
149
Member Avatar for nabil1983

Does anyone know the code to show the critical count for a quick sort algorithm. Basically my cd database is almost finished. What i need to do is show a critical count for the quicksort quicksort for my database [CODE]void q_sort (struct CdRecords array [], int count) { quick_sort(array,0,count-1); } …

Member Avatar for nabil1983
0
307
Member Avatar for akki_freak

help me with this....here i m trying to write into a file(which i have already created n saved in C:\ drive) from stdinput i.e. keyboard and then reading from that file and displaying on stdoutput....but its isn't working... :rolleyes: :rolleyes: tell me why????????? by the way i m using GCC …

Member Avatar for WolfPack
0
90
Member Avatar for heavyc

I have a problem i have a fully operational C++ code that works but when i convert it to ASM (assembly) code it doesnt work I dont know where I am going wrong but here are both codes.. [code] #include <iostream> using namespace std; int main() { int n, tmpA, …

Member Avatar for heavyc
0
220
Member Avatar for ilikerps

Hello, I am having trouble with arrays. Basically, this is what happens: [code] vector <char*> constArray(10); char* changingString = "hello"; constArray[0] = changingString; changingString = "hi"; printf("constArray[0] = %s\nchangingString = %s", constArray[0], changingString); [/code] Output: constArray[0] = hi changingString = hi So, I think constArray[0] is changing because it points …

Member Avatar for ilikerps
0
146
Member Avatar for nabil1983

im trying to do a sort for the array structure records that i have entered... so far i've tried to use a book to do the coding...but im lost.. can anyone tell me if im on the right track or where im going wrong!!! [CODE]#include <stdio.h> #include <stdlib.h> #include <string.h> …

Member Avatar for perniciosus
0
199
Member Avatar for nabil1983

Hello I've rearranged my program so i can enter more than one word for a field and it works,, new problem is after just entering data once,, i get stuck in the menu with a loop. tried all kinds of stuff to get out but cant. what i want to …

Member Avatar for HyperEngineer
0
154
Member Avatar for Acidburn

I know I've asked but I'm now faced with a different problem. The last implementation went wrong since the number of chars on a given line is u known. ie [quote] John 15 nmmo short brown hair look young Andrew 22 young long bloack wavey hair with blue eyes. etc... …

Member Avatar for Ancient Dragon
0
132
Member Avatar for nabil1983

'ello whenever i compile i keep getting an error saying identifier or declarator expected....for some reason i cant correct it neone know whats wrong??? [CODE]#include <stdio.h> #include <stdlib.h> #include <string.h> void filewrite(void); void fileprint(struct tuple *myDB); // Idea here is to enter an array of structures // write them to …

Member Avatar for Ancient Dragon
0
246
Member Avatar for akki_freak

greetings folks, #include<stdio.h> #define T t void main() { char T = 'T'; printf("\n%c\t%c\n",T,t); } just check what is the output of this program and puhleease tell me reason whyit happens so?? :rolleyes:

Member Avatar for Ancient Dragon
0
131
Member Avatar for SNA

Hello, If I want to check my algorithm if it works good in every cases so can i check very outer cases and then I can conclude that my algorithm works well in all cases?

Member Avatar for perniciosus
0
207
Member Avatar for sheldonhigh16

i am doing a project on computer programing and i need someone to be working in that field to answer some of my questions......... Here are the questions: 1. What degree do you need to be able to work in Computer Programing? 2. Is this job hard? 3. Is this …

Member Avatar for dwks
0
89
Member Avatar for SpS

We can call static member function through both class name and objects...but we generally use class name to call static member function instead of objects.... Is there any performance benefit in it by using class name or is it just to remove confusion by not calling through object

Member Avatar for SpS
0
140
Member Avatar for prasath

Hi guys, Will you guys please suggest me some good books for TEXT compression with programming examples given in c or c++. Hope you guys will help me. :) prasath.

Member Avatar for perniciosus
0
165
Member Avatar for ban26ana

I don't really understand arrays. I'm getting myself quite confused here. I have to answer a bunch of questions regarding a 2x3 integer array t. Here are the questions that I'm still having a problem with: 1. Write a nested for structure that initializes each element of t to zero. …

Member Avatar for SpS
0
136
Member Avatar for ilikerps

How does one reset an array, to make it retain its size but get rid of all data it has stored? Would one do it by setting all the array values to '\0'?

Member Avatar for SpS
0
521
Member Avatar for nabil1983

Ok i've tried understanding some previous posts but im just finding it really hard to work with structure passing to other functions and sorting. Can someone please explain in a simplistic on how i can pass structure to a function that sorts the structure by 'Year' or 'Artist' Below is …

Member Avatar for Ancient Dragon
0
158
Member Avatar for akki_freak

hi folks, plz try sending answers to folllowing questions....i know they are a lot..still...send as many as possible..... Write a "Hello World" program in 'C' without using a semicolon. Write a C++ program without using any loop (if, for, while etc) to print numbers from 1 to 100 and 100 …

Member Avatar for Rashakil Fol
0
376

The End.