15,551 Topics
| |
Hi, Is there anyone who know which complexity these functions are? I mean O(n), O(n^2), O(n^3), n log(n) or log(n) 1. --------------------------------------------- [CODE]void bogosort_array(double a[], int length) { do shuffle_array(a, length); while (! is_array_sorted(a, length)); }[/CODE] 2. --------------------------------------------- [CODE]void reverse_string(char* s) { int n = strlen(s); for (int i = … | |
I am writing a program that will take a sentence and find out how many of one character (like how many h's) is in the sentence. I have started what I think works and got the program to work once but after the one time I cant get it to … | |
Hi, I'm a BSD Socket beginner and I would like to make a small networking program written in C. I've read many instructional articles and I haven't found a example how to send/receive a non-char - string sending everywhere. I mean, I thought about sending some various structures as "frames". … | |
Basically I've finished my code for the most part and I'm having trouble figuring out how to initialize loan, mort_gage, and downpayment. Is it possible to use a pointer for each of these and call the address back to main? I'm so confused...it's just one of those little things that's … | |
I was writing a file copying program. Mind you this is an any file copier. That is, at this moment, this function can copy only text files but i'm trying to copy mp3 files, avi files, mkv files etc, which this cannot. Here is just the copying function. However it … | |
i've been at this problem for hours now, and so thought of asking help from people who are not such newbies to programming as i am. please help me with this: i have to print the result of a specific element in a pascal triangle, taking only rows and position … | |
Hello, I've to make a c program with the next specs: Write a function that is specified as follows: bool lees_file (char *, int [] [KOLOMMEN_IN]); The function has as parameters a pointer to a file name and a two dimensional integer array and a return value of type boolean. … | |
there have problems with the output and the calculation... [CODE]void Mark_Attendance() { int answer, temp_Att; FILE *ExistingFile, *AppendingFile, *ReadFile; ExistingFile = fopen("Attendance.txt", "w+"); AppendingFile = fopen("Attendance.txt", "a"); ReadFile = fopen("StudentDetails.txt", "r"); if(!ExistingFile || !AppendingFile || !ReadFile) { system("cls"); printf("This File Cannot Be Open Successfully!!\n"); printf("Please Check It!!\n"); exit(-1); } else … | |
Hi All, i want to know what is the use of const volatile variable, where exactly it is required to use. | |
Hello, We are trying to control 8 7-segment displays by using multiplexing. The problem we have is that we have to program buttons, how can we make it? Best regards, Floris /* Ansteuerung von drei 7-Segmentanzeige im Multiplexbetrieb * Gemeinsame Anode, PB0..PB6 * Spalten: PC0..PC2 * * a * f … | |
i need a help in airline reservation system project in c n i dont no how to do that so plz tell me the codes for these we should allow the user to chose 1)to book 2)to cancel 3)view data 4)quit as well as they have to enter them name … | |
Hey all, I'm trying to implement a function InitMatrix which suppose to return a pointer to a new created 3d array of the size determined by x,y and z. I have a struct which represents a matrix and should be able to deal with some functions required, like setting the … | |
Hi i ve been dealing with a program and encountred a weird problem. the problem is that my array variable por[27][1]'s value changes for no reason. please take a look at the pictures in the attachment. the pictures belong to debugging. | |
Hello, I have an assignment where we are supposed to populate an operating system's ready queue with processes and try various process scheduling scheme and record their wait times. To do this i made a rudimentary structure for a process: [CODE]typedef struct{ int ID; int wait_time; int exec_time; }process; [/CODE] … | |
I am learning C++. This class project was to write a program that will let you enter a diver's first and last name and city. Also 5 judges results along with the difficulty for the course. Then display the results. It is suppose to ask if you want to enter … | |
Salam, My mission is to program a cube[I](given its dimensions (x,y,z))[/I]. The cube will be represented in a struct, which I'll choose what data members it should contain. I need to implement the allocation function(which actually creates the matrix) and some other functions. The most important function is the setter … | |
[COLOR="Green"]Hi, I'm trying to write a linked list Program to accept a no. and print all the prime numbers less than it, using the sieve method, Explained below: Suppose that n=30.Then we list all the numbers till 30, and cross out 1 and all the multiples of 2, then 3,then … | |
Hi DaniWeb, [INDENT]So when you right click an .exe file (one you compile with C) you get the option to view the details such as File Description, File Version, Product Name, etc. I was wondering how to change these? I assume it'll be a C command, but I'm not entirely … | |
I erased this post because I made a mistake in it. Sorry | |
Hello guys, Can someone explain what is going on on this code? 1. why we needed **p in the function [B]AllocString[/B]? 2. why if I change [B]AllocString(strlen(s), ©);[/B] to [B]AllocString(strlen(s)-7, ©);[/B] I can still get a good result? Thanks! [code=c] #include <stdlib.h> int main() { char *s="example"; char *copy=NULL; AllocString(strlen(s), … | |
Hi, I am trying to figure out how to get my program to do one of two things: Either... 1. Create and remove a semaphore based on me entering a 'r' in the command line at argv[1] or 2. If argv[1] is a 'n', then I want check to see … | |
[[url]http://lxr.free-electrons.com/source/drivers/net/8139too.c#L498][/url][1] On above link What I am not getting is the structure [CODE] static const struct { const char *name; u32 version; /* from RTL8139C/RTL8139D docs */ u32 flags; } rtl_chip_info[] = { { "RTL-8139", HW_REVID(1, 0, 0, 0, 0, 0, 0), HasHltClk, },[/CODE] gets expanded to [CODE] static const … | |
Hello; I would like to compress an 1D array of arbitrary number of elements. For instance if a user inputs IN : 111122233331 OUT: 14233411 [it shrinks/increases the array and replaces all the identical consecutive elements with a number of how many times theyve appeared.] This task must be accomplished … | |
Hi all, Quite a basic question for most of you; I am trying to obtain length of a string < char [b]name[MAX_ENTRIES][MAX_NAME_SIZE][/b] > for use in a for loop that will perform isalpha. [size=3][color=blue]for (int j=0; j < &name[i].length(); j++)[/color][/size] [color=black]I am getting [/color][color=red]error 2228: left of '.length' must have … | |
Hi I am new to C. I'm taking an operating systems class right now and I have a project that requires me to create a set of semaphores. The command line takes in: filename ropt NS value1 value2 value3...valueNS Where argv0 is the filename Argv1 is the option to remove … | |
Hi, I'm writing a large program but require Multithreading for this software. I've searched the web for just over an hour and now is just after midnight but still can't find anything simple. The only thing I saw that came close to what I need was at [URL="http://www.computersciencelab.com/MultithreadingTut1.htm"]http://www.computersciencelab.com/MultithreadingTut1.htm[/URL] but I … | |
I am writing a calendar in C. I'm still very new to the language. I think i wrote most of the functions/algorithms correctly (it would be nice if you guys could check for any errors too). Now I'm having a tough time printing the calendar out In a correct format. … | |
I am not sure if this is more software problem or C problem. Nevertheless, I am trying to run simple test code to check if my lapack installation is OK. [CODE]#include <stdio.h> #include <atlas_enum.h> #include "clapack.h" double m[] = { 3, 1, 3, 1, 5, 9, 2, 6, 5 }; … | |
Hello, i needed suggestions regarding the book "Art of Computer Programming" by Donald E Knuth. im an undergraduate Computer Science student. i would like to know more about the book before i buy it. So, any reviews? Reviews as to how the Math in it is(i heard there are a … | |
Hi all. I would like to write a network server in C to run on debian linux. I have some network code thats working, BUT at the same time I want to read data from a serial port, and process it. I want to build a linux based server to … |
The End.