19,876 Topics

Member Avatar for
Member Avatar for xyz1987

Can anyone help me with searching for a particular address in a given range in C. like i have to search for *ptr in range specified by *high and *low. i think it is not same as linear search. can someone provide some input. thanks.

Member Avatar for gerard4143
0
74
Member Avatar for zozanthonyzoz

Hi all, I need to have a program to word count remove punctuation and sort it in alphabetical order. I had done the word count portion but i am lost in removing punctuation and sorting in alphabetical order portion. Hoping to get some help. [code] #include <fstream> #include <iterator> #include …

0
259
Member Avatar for saad749

Hi, I am trying to make a Picture viewer for my BS Computer Science 1st Year Project in [B]Turbo C Compiler[/B]. I have to stick with this compiler atm. I want to be able to display BMP,PNGs and JPEGs [TIFF and others too if it won't be very difficult]. I …

Member Avatar for Ancient Dragon
0
1K
Member Avatar for murtazamzk

Below is the program for swapping variables without any extra variable. [CODE] #include "stdio.h" #include "conio.h" void main() { int a=7;b=5; clrscr(); a=a+b; b=a-b; a=a-b; getch(); }[/CODE]

Member Avatar for Kamatari
0
177
Member Avatar for geojia

Hi, this is my first time posting and I would like thank everyone in advance. I'm doing a homework assignment that requires me to design a teller application which simulates a bank. I'm currently getting a segment fault, after I call one of my getBranch(). I've tried to do this …

Member Avatar for geojia
0
181
Member Avatar for imprezal2345

I've finished a void display function for an in-game menu. I'm trying to have the menu stay at the top of the cmd for the length of the game. However, since it's a separate function, the program stays in the menu function, and never reaches the functions that follow it. …

Member Avatar for imprezal2345
0
1K
Member Avatar for borogirl09

I am working on a program that reads students name and test score from a file. The program should assign the appropriate letter grade, then output the name score, and grade. It should also determine the highest test score. I do not see where my errors are. Please help! [CODE]// …

Member Avatar for VernonDozier
0
155
Member Avatar for apbarratt

Hi guys, I would like to add a char to the end of a char* So imagine the following: char* test = "ABC" I want to add D to the end of it to get test == "ABCD" for the sake of argument, I can not use strcat as I …

Member Avatar for apbarratt
0
187
Member Avatar for berwick53

Hi, Im trying to make a caesar cipher, but a windows error comes up when running. Where have I gone wrong?? Sam [CODE]///////////////////////////////////////////////// /// /// /// NAME: SAM BERWICK /// /// DATE: 18/11/2010 /// /// PROJECT: CAESAR CIPHER /// /// /// //////////////////////////////////////////////// #include <stdio.h> /// Stand In/Output #include <string.h> /// …

Member Avatar for NP-complete
0
87
Member Avatar for libathos

I want to make a button in a root window.My question is should i draw it or shoud i make a new window in my root window?

0
101
Member Avatar for NichtSoGut

So basically it involves sodding scanf(). [CODE]int NumericalAnswer; int score = 0; main() { printf("Question 1: What's 4 x 3?\n"); scanf("%d\n", &NumericalAnswer); if (NumericalAnswer == 12){ printf("You got it right!"); score += 1; } }[/CODE] Output [ICODE]Question 1: What's 4 x 3? 12 9 You got it right![/ICODE] As you …

Member Avatar for Narue
0
115
Member Avatar for florisvd

Hello, I´ve got a question about multiplexing 7 segment displays. I already have working 1 7 segment display. How can I control more 7 segment displays? Now only the 3th display can be controlled. This is the code I've made: #include <avr/io.h> #include <util/delay.h> #define F_CPU void delay_ms(uint16_t); void digit …

0
64
Member Avatar for atramposch

I wrote a short piece of code to give me a .dat file for use in another program. But i cant figure out what is wrong. I run on a mac, and use Xcode. [CODE]#include <stdio.h> #define ARRAYSIZE 1500 #define BINDATA "file://localhost/Users/Hub/Desktop/231A4binData.dat" int main (void) { int i; double dblData[ARRAYSIZE]; …

Member Avatar for Ancient Dragon
0
169
Member Avatar for mpassaglia
Member Avatar for Perry31

Hi, Can anyone explain in detail what is the difference between int *a and int* a? Is there any difference between them?

Member Avatar for Ancient Dragon
0
85
Member Avatar for dduleep
Member Avatar for Jmknight
0
105
Member Avatar for foobar8

Hello, I have a program that is like a ftp server - it sends and receives files over unix sockets. It works fine when I transfer text files, but as soon as I want to receive binary files, it's not working properly. Files are transferred correctly, I can verify that …

Member Avatar for mrropi
0
946
Member Avatar for berwick53

Hi what methods of encryption could I use to encrypt a text document. It must use C and not C++. Cheers Sam

Member Avatar for Adak
0
120
Member Avatar for terabyte

Hello I'm starting to learn c++ and I'm wondering if I should wait until c++0x standard is published (since I'm not in a hurry, currently learning Perl and Java) or should I start learning c++ with an old book I have If i do learn c++ w/ the 2003 standards …

Member Avatar for Bench
0
147
Member Avatar for tagazin

Hello, I'm trying to realize a simple calculator but when I double click the file.exe to see the output, my program keeps running in the terminal, maybe I created an infinite loop.. I'm using cin.get() I don't understand.. I compiled it with G++ (MinGW), using Win Xp. can someone help …

Member Avatar for tagazin
0
363
Member Avatar for atramposch

i know there is probably a trick for this in C that i do not know, but i attempted to write my own function for finding the mode of an array of data (As large as 1500 doubles). Heres my crack at it. [CODE]void mode (double * array, int numItems) …

Member Avatar for atramposch
0
101
Member Avatar for praneeth_gunda
Member Avatar for halil.burak

i need help with the 5th case in the submenu! Several 2-dimensional geometric shapes, area, and a program for environmental accounts are required to be made. To do this, first run the program in a main menu displayed on the screen as follows: MAIN MENU 1. Area Calculation 2. Perimeter …

0
108
Member Avatar for florisvd

Hello, I´ve got a question about multiplexing 7 segment displays. I already have working 1 7 segment display. How can I control more 7 segment displays? Now only the 3th display can be controlled. This is the code I've made: #include <avr/io.h> #include <util/delay.h> #define F_CPU void delay_ms(uint16_t); void digit …

0
71
Member Avatar for onus

On this link [url]http://lxr.ncu.cc/source/kernel/timer.c#094[/url] a return type is defined [CODE] return ((unsigned int)(unsigned long)base & TBASE_DEFERRABLE_FLAG); [/CODE] What is the above function returning.I am not clear with definition of what is being returned in the above code.

Member Avatar for onus
0
167
Member Avatar for vinitmittal2008

Write a 'C' Function to combine two singly connected linked lists in the following manner. Suppose one list is "L" which can be given by L=(l0,l1,.....,lm) and the other list is "M" where "M" can be expressed as M=(m0,m1,......,mn) where each li,mi represents one node in the respective lists. For …

Member Avatar for vinitmittal2008
0
173
Member Avatar for codemogul

someone please help me with printing out body parts... read in word from list..user inputs letter.when correct letter is place on line..else ..im stuck here..cannot print out body part when input is wrong.. [CODE]#include <iostream> #include <fstream> #include <iomanip> #include <string> #include <ctime> using namespace std; void pickword (); int …

Member Avatar for mtbs1826
0
91
Member Avatar for george_82

Hi All, Can somebody explain what is the difference between (char*) and (char**). I am just looking for an explanation of in byte level. Also please refer any documents related to this. Thanks

Member Avatar for sree_ec
0
89
Member Avatar for maggie_fairy

im a first year engg student. i need 2 make a report on cryptography and i need the source code in C for caeser cipher. as it so happens im not very good at c programming... please help can u tell me wats wrong wid this program? #include <stdio.h> void …

Member Avatar for darkbreaker
0
325
Member Avatar for Futchy

so i just started this programming class in school today, im having alot of trouble, i dont want everyone to do the work for me, but i would love for you guys to tell me what needs to be done, i know this is alot to ask so if anyone …

Member Avatar for darkbreaker
0
417
Member Avatar for yuri1969

Hi, I would like to make an threaded app which would use pthreads. I made a linked list and I put references to running threads here. I know that operations of adding a new thread reference to the list and removing a thread reference from the list after the thread …

Member Avatar for yuri1969
0
178
Member Avatar for slatk3y

Hello, I want to redirect stdin and stdout of "cat" program to my program. For example if I type "cat" in terminal, and enter input and press enter it outputs the same string I entered. In my c program I am trying to use pipes and dup. I cannot figure …

Member Avatar for slatk3y
0
246
Member Avatar for MarounMaroun

Hello all, I have this code: [code=c] void SetMatrixRange(MyMatrix * matrix, int xfirst, int xlast, int yfirst, int ylast, int zfirst, int zlast, int value) { int i,j,k; for(i=xfirst;i<=xlast;i++) for(j=yfirst;j<=ylast;j++) for(k=zfirst;k<=zlast;k++) matrix->m[(i*ylast*zlast)+(j*zlast)+k]=value; } [/code] I allocated the matrix like this: [code=c] MyMatrix * CreateMyMatrix(int x, int y, int z) { …

0
67
Member Avatar for alviss_88

Hi! i trying to take the same value from 2 arrays and then count how many time of it. However, when i compile, it run ok. but it did not print out the value of coutting. I did not know why, i had tried several times to fixing. please help …

Member Avatar for Perry31
0
309
Member Avatar for medamineb

hi everyone, i'm trying to do a program in c, GCC UNIX and i have this error: warning: passing argument 2 of `write` makes pointer from integer without a cast i try to use TUBE, communication between process and i use `write(fd[1],2,1);` but it gives this error please i nead …

Member Avatar for medamineb
0
1K
Member Avatar for AspiringGuru

I absolutely hate hate hate hate HATE to be doing this, because I've figured out every other program I've done relatively alone with my C Book. I'm writing a program that declares an array of structs, each with a name and age field. The data is read from a file …

Member Avatar for sree_ec
0
95
Member Avatar for wvuengr33

The program I am writing is supposed to read in a txt file and then align the txt depending on the number of characters per line that the user has specified. Since there aren't any limitations to the length of the text it has to be represented using a dynamic …

Member Avatar for griswolf
0
336
Member Avatar for Hi-Tone

Dear all, Im trying to do a matrix multiplication with complex number. I have 2 structures: [code=c] /* Structures */ typedef struct complex { // Complex structure = real and imaginary part. double re; double im; } Complex; typedef struct complex_matrix { int rows; int cols; Complex **mat; } Complex_Matrix; …

0
32
Member Avatar for bufospro

Hi all, I am trying to read a file in C. The format of file is something like that : ----------------------------- <From: [email]sender@hotmail.com[/email]> Hellooooooooo. </from> <From: [email]george@gmail.com[/email]> What am I doing? nOwwwwwwwwwwwwww </from> ---------------------------- I would like to read the file and extract some info like number of emails , …

Member Avatar for Ancient Dragon
0
81
Member Avatar for I<3soccer

Hello, I'm working on an inventory program in c and having a lot of trouble with it. I've compared my code to several examples in the book and it seems right but I'm having these problems: 1. When I try to list the tools, the program ignores the command and …

0
52
Member Avatar for dnambembe

Hi, I am writing a code that reads input from user to create a linked list database at the same, time it write the data received in to binary file. when I run the program is supposed to prompt the user to enter the data for ten time, however the …

Member Avatar for dnambembe
0
1K
Member Avatar for sallubhai

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 = …

Member Avatar for sallubhai
0
210
Member Avatar for biju127

Whats wrong with this code. I can create the DAT file.Name and Grade is writing to the file perfectly. but the file contains ASCII values for RollNO and after Grade. [B]Output file:[/B] Name A ÈB [B]Program[/B]: #include<iostream.h> #include<conio.h> #include<fstream.h> #include<string.h> class stu { int rollno; char name[20]; char grade; float …

Member Avatar for biju127
0
217
Member Avatar for armanus

I'm attempting to make a Tic-Tac-Toe against the computer program, I'm pretty much done, but i can't figure out how to stop the computer from making the exact same move as the human does. Thank You. [CODE]// Include the libraries #include <iostream> #include <string> // Use standerd namespaces. using namespace …

Member Avatar for SgtMe
0
181
Member Avatar for Chocolatemoon

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 …

Member Avatar for Chocolatemoon
0
121
Member Avatar for yuri1969

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". …

Member Avatar for yuri1969
0
176
Member Avatar for muramasa007

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 …

Member Avatar for muramasa007
0
135
Member Avatar for xavier666

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 …

Member Avatar for ronnieaka
0
118
Member Avatar for silver90

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 …

Member Avatar for Adak
0
115
Member Avatar for florisvd

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. …

Member Avatar for Ancient Dragon
0
210

The End.