15,551 Topics
| |
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 … | |
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 … | |
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 | |
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 … | |
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 … | |
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, … | |
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 … | |
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++; … | |
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 … | |
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, … | |
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 … | |
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 … | |
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 … | |
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 … | |
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 … | |
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 … | |
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 … | |
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 ; … | |
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 … | |
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() … | |
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 | |
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 … | |
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 … | |
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 … | |
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 … | |
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 … | |
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); } … | |
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 … | |
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 … | |
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> … |
The End.