18,490 Topics

Member Avatar for
Member Avatar for bobbyross

I am new student in c programming class and I have to do a program that shows "currency Conversion" and then make a flow chart and control sheet.

Member Avatar for WaltP
0
236
Member Avatar for mikabark

I'm doing programming which can traverse subdirectory and show lists. If I check just file part, it was not problem. But when I do directory part, and have to recurse program itself(I marked as "from this part"), it show strcat segment error. I'm thinking it's problem if string and char* …

Member Avatar for WaltP
0
127
Member Avatar for hsp700

Is there any character that takes cursor to previous line? printf("H\n"); will print H and then take cursor to newline(1 step down). output: ............ H _ ............ But is there any control character that will work in the following way: printf("\nH(the character i am finding)"); takes cursor in newline, prints …

Member Avatar for Dave Sinkula
0
87
Member Avatar for Rajesh iPhone

[b]Split from - [url]http://www.daniweb.com/forums/thread33991.html[/url] [/b] Hi, I need a logic to align 10 variables in different order every time a user logs into the application. Thanks in Advance :)

Member Avatar for Salem
-3
48
Member Avatar for jdpjtp910

I have a program for school. The program is an inventory program. It will start by writing blank records to a file. The user then should have a case drive menu. The user will select an option for what action they desire. Actions are add new record, change record, and …

Member Avatar for dusktreader
0
2K
Member Avatar for Member #356299

I've been given an assignment in class to take some code and work on improving the optimization, we can either write new code or use old code. For some reason I can't think of anything that would be a good example of code that can use multiple optimization techniques, I.E. …

Member Avatar for Member #356299
0
107
Member Avatar for sfreema4

I am having issues with outputting a string correctly that is coming from a 4K read buffer. Here is the code I have currently: read_4K.c (cannot be modified) [code=c] int read_4K(char *b) { return read(0, b, 4096); } [/code] reader.c [code=c] static char Buffer[4096]; static int Bend = 0; static …

Member Avatar for tmoorez06
0
227
Member Avatar for gagan gowda

hi, i am doing a project in c(linux).the topic is authenticating and authorizing the client before accessing the file from the server.i already wrote the code for creating a client and server with allowing access to 10 client.for authentication if u cant give some tips or code please do reply.

Member Avatar for gagan gowda
-1
90
Member Avatar for arsenal_fan

Hi, I got this code for computing permutations of a string from the programming interviews exposed book. I am unable to think as to how recursion works in this case. Now, if the input string is "hat", then I have understood the sequence of recursive calls that lead to the …

Member Avatar for Ancient Dragon
0
157
Member Avatar for eablair

[b]Split from - [url]http://www.daniweb.com/forums/thread47395.html[/url] [/b] [QUOTE=rhp405;226272]Ok, here's the solution. When you have a pipe open in parent process, you have to close the pipe before waiting. It has to do with the file descriptor counters of the pipe ends, they have to be zeroes to not cause a child to …

Member Avatar for eablair
0
186
Member Avatar for abhimanipal

Hello People, Does any one have any practice problem sets for C. I am interviewing for a company tomorrow and they ask lots of "Whats the output ?" kind of questions.. Any help would be appreciated

Member Avatar for Salem
0
111
Member Avatar for gangsta1903

[code=c] #include <stdio.h> int main() { char name[50]; printf("enter your name:"); gets(name); puts(name); return 0; } [/code] hello, the above program should first print out "enter your name:", but it does not. it occurs in this way on the console: --------------------------- abc enter your name:abc --------------------------- it prints "enter your …

Member Avatar for gerard4143
0
94
Member Avatar for Kombat

I am trying to be able to read in 1 000 1 1 1 as like 100011. Also when I do printf of the string program crashes. Here is my code [CODE]#include <stdio.h> #include <string.h> #include <ctype.h> #define MAX 32 int main(void){ int i; int c; char a[MAX]; char b[MAX]; …

Member Avatar for Kombat
0
171
Member Avatar for badlucky

so i have my main program which reads in a data file through the command line, and the data file is a list of names, each line consists of "last name first name" (no quotes obviously) all i want to do is print out the list of names as "first …

Member Avatar for badlucky
0
91
Member Avatar for PMACLEAN

Could someone please advise me on how to implement fork() in a parallel processing (multiplying) of a 2d array....I have been at this for far too long.. here is my code [code] for (int i = 0; i < rowCol[0]; i++ ) result[i] = (float*)malloc ( rowCol[1] * sizeof(float) ); …

Member Avatar for abhimanipal
0
198
Member Avatar for ppotter3

Hello, I am working on a program that takes an integer array filled from a random number generator. These values are suppose to be from -5000 to 5000, 2500 of them. Then I want to find the standard deviation of the numbers in the array. I am required to use …

Member Avatar for ppotter3
0
1K
Member Avatar for vinodhkumar
Member Avatar for Salem
-1
50
Member Avatar for cecilia_g1

Hola, Necesito leer un valor de una variable como hexadecimal, y guardarlo en otra, pongo el codigo y quiza con eso quede mas claro. Tengo esto: buffer es un arreglo de caracteres y aux tambien buffer[i] = atoi(aux); Un ejemplo: atoi(aux) me regresa 40 entonces yo quiero que el valor …

Member Avatar for Narue
0
152
Member Avatar for cecilia_g1

Hi all, How can I do assign a Hex value to variable from other variable. I mean I have this: buffer is a char array aux is a chara array buffer[i] = atoi(aux); atoi(aux) return for example 40, then I want to see the value 40 on the buffer[i], but …

Member Avatar for WaltP
0
109
Member Avatar for cecilia_g1

How can I do assign a Hex value to variable from other variable. I mean I have this: buffer is a char array aux is a chara array buffer[i] = atoi(aux); atoi(aux) return for example 40, then I want to see the value 40 on the buffer[i], but is not …

Member Avatar for WaltP
0
88
Member Avatar for icu222much

I am trying to program with semaphores and was told that I should use sem.h. When I compile, I get the error: "sys/sem.h: No such file or directory". How can I fix my problem? [CODE]#include <stdio.h> #include <sys/sem.h> int main() { printf("I am alive \n"); getchar(); return 0; }[/CODE]

Member Avatar for icu222much
0
1K
Member Avatar for rajdesire

How can we use volatile variable in C or C++? Anybody can some good code to understand this.

Member Avatar for gerard4143
0
171
Member Avatar for shrublet

Hello there, I am a Java programmer by trade and am VERY new to C so please excuse any blatant pointer ignorance, if possible. I am having a problem with the concept of returning something but also freeing it afterwards within a method. I am implementing a stack program and …

Member Avatar for rajdesire
0
136
Member Avatar for asm2hex

Hello, I'm having quite a hard time getting around this access violation error I keep getting. Every time I declare a character string in a structure I can never access it. Here's a small example of my code that keeps giving me a error no matter what I try. [CODE] …

Member Avatar for JuhaW
0
128
Member Avatar for sandorlev

Hello! I've started programming C++ a week ago, so I cannot solve my problems easily. I've started a small project for learning classes, it's about encryption and stuff. I don't really get pointers, although I've read some about them. My problem is that when I use the cipher, it replaces …

Member Avatar for vmanes
0
801
Member Avatar for sumanpc

hello to all my frnz... Actually i need 2 generate a program to find out how many processors are running at the n machines by devoloping a client server model using a unix enviroment!! i wud b really grateful if someone gives the c code for it!!! thank u:)

Member Avatar for Salem
-1
26
Member Avatar for liljj2005

if i have this code: [code=c]int main(int argc, char *argv[]) { struct tm tmbuf; time_t timeinsecs; int n, rc; char req[16], resource[128], proto[16], fname[128]; char buffer[1024], dates[64]; rc=read(0,buffer,1024);[/code] how would i go about extracting the three substrings into req, resource and proto using the sscanf function? can someone please talk …

Member Avatar for Dave Sinkula
0
241
Member Avatar for Kru

Hello I have two c files I am working on. One is a stand alone program (I will call it helper) that will take two ints as a command line argument, add them together, prints the operands and the sum, and exits. This program can be run from the command …

Member Avatar for Kru
0
170
Member Avatar for ankur_

I have taken the opensoruce from ~wagnerr/ConfigFile.html for reading configuration file. It perfectly works fine with gcc 3.2.3 and it fail to compile with gcc 3.4.3 on RHEL 4 I am getting following error g++ -Wno-trigraphs -Wno-unused -Wno-deprecated -Wpointer-arith -fno-common -fno-strict-aliasing -fexceptions -DC_GCC_C -DC_GCCBJC -DC_GCC_CPP -fPIC -D_GNU_SURCE -DC_GNUSTEP -DC_LITTLE_ENDIAN -DDEBUG …

Member Avatar for gerard4143
0
381
Member Avatar for kymarscheng

How to store the data of a program without using registry? Because I don't want the users change the registry and the program settings... Are there any other ways that can prevent the users from changing the settings?

Member Avatar for kymarscheng
0
181
Member Avatar for FreakNFlow

I am in need of some help. I need a program that will play the game Three's Free. You roll six dice. 3's are equal to 0. Every turn you take away one of the dice, so every time you roll you take away one die. If you don't roll …

Member Avatar for WaltP
0
109
Member Avatar for solitude_spark

dis is a simple c program.. but while using it in borland c++ 4.5 ,, declaration syntax error is being displayed at file1.h ..why so? file1.h [CODE] #define USD 1[/CODE] file2.h [CODE] #define UKP 1 [/CODE] file3 [CODE] #include<stdio.h> #include <file1.h> #ifdef USD #define curr 46 #endif #ifdef UKP #define …

Member Avatar for Nick Evan
0
111
Member Avatar for robbtek

Hello , I need to pass a system (linux) result to a varaiable . Example : ... char KERNEL = system("uname"); printf(KERNEL); ... this example dont work , can you help me ?

Member Avatar for Salem
0
397
Member Avatar for kylcrow

I am getting this compiler error: gcc -g -Wall -O2 -c -o mybash.o mybash.c mybash.c: In function ‘main’: mybash.c:39: warning: implicit declaration of function ‘getline’ mybash.c:41: error: expected expression before ‘)’ token make: *** [mybash.o] Error 1 It probably has to do with something I don't remember about initializing and …

Member Avatar for kylcrow
0
176
Member Avatar for cmsc

please help me find the error in this code. whenever i try to get the successor, the program gets the status access violation error. i think it's the parameter. i try using the minimum function outside the delete and it works. but when i try it inside the delete i …

Member Avatar for cmsc
0
219
Member Avatar for Diode

I know they don't have standard ASCII values, but how do you check for them? I am making a command prompt-type interface for a text-based RPG a friend and I are making, and I would like to be able to use the arrow keys to navigate in menus. I am …

Member Avatar for hsp700
1
4K
Member Avatar for aianne

Hi! I need your help!! My teacher wants us to create flowchart with this code from turbo c : [CODE=c]#include<stdio.h> main() { int grade; clrscr(); printf("Enter Grade:"); scanf("%d",&grade); if(grade<=74 && grade>=70) printf("Sorry, You Failed!"); else if(grade>=75 && grade<=100) printf("Congratulations! You Passed!"); else if(grade>=101 && grade>=101) printf("Invalid Grade"); else if(grade<=69&&grade<=69) printf("Invalid …

Member Avatar for BestJewSinceJC
0
211
Member Avatar for WargRider

Hello Everyone, As you can see, I am new to DaniWeb, and might I say this is a VERY good community. Either ways, my problem is a pretty complicated one, which I have been working on for a while now, 2-3 weeks. I am assigned by my team to create …

Member Avatar for Nick Evan
0
415
Member Avatar for batman3

[b]Split from - [url]http://www.daniweb.com/forums/thread8443.html[/url][/b] How do you post each integer in a seperate line once it has been reversed?

Member Avatar for WaltP
-2
48
Member Avatar for Covinus

greetings again. few more question.. [code] /*----------------------------------------- MENUDEMO.C -- Menu Demonstration (c) Charles Petzold, 1998 -----------------------------------------*/ #include <windows.h> #include "resource.h" #define ID_TIMER 1 LRESULT CALLBACK WndProc (HWND, UINT, WPARAM, LPARAM) ; TCHAR szAppName[] = TEXT ("MenuDemo") ; int WINAPI WinMain (HINSTANCE hInstance, HINSTANCE hPrevInstance, PSTR szCmdLine, int iCmdShow) { HWND …

Member Avatar for downtimedk
0
523
Member Avatar for Whilliam

Hello. Im new to Trie. I know it's concept but I can't declare and access it correctly. I tried making a code. It's like this. [code=c] #define max 27 typedef struct ctype { struct ctype (*letter)[max]; int counter }trie void main() { trie t; int ctr; for(ctr = 0; ctr …

Member Avatar for abhimanipal
0
99
Member Avatar for ibuguser

Hi, I have a program that writes to a specific memory location. I can currently read the value doing this: [CODE] #define address1 0x000F0000 //this is the memory location unsigned long *val1 = (void *) address1; [/CODE] So * val1 contains what I need from the other program. Now I …

Member Avatar for gerard4143
0
161
Member Avatar for priyarrb

This is an CPU sheduling algorithm i.e proirity sheduling .It show some error that i can't solve please anyone correct it . its very urgent.[code]#include<stdio.h> #include<conio.h> void main() { int a[20],b[20],c[20],e[20],d[10],totaltime; int att,at,aw,awt,t1,i,j,n; clrscr(); printf("\n\t\t\tpriority scheduling"); printf("\nEnter the no of process: "); scanf("%d",&n); for(i=0;i<n;i++) { printf("\n"); printf("\nprocess: "); printf("%d",i+1); c[i]=i+1; …

Member Avatar for abhimanipal
-1
151
Member Avatar for mattitude

Basically, I'm writing some code that will take text from some .txt files and rearrange them into other .txt files. I've written 3 functions, but ignore the 2nd one, I haven't worked on it yet. When I try to call my 3rd function, I get an error message from Dev …

Member Avatar for mattitude
0
409
Member Avatar for swathydoss

hi....... i want a program in c based on any data structures with de code.plz............it shd be catchy n can be based on reality

Member Avatar for jephthah
-4
94
Member Avatar for ubi_ct83

hi all, thanks for reading my post. sorry about the tittle (so whatever ;)) i have this situation. i have an array like this: lemon banana pineapple and i have fruit.txt which has this inside: corn melon berry blackcurrent apple what i want to do is, i want to copy …

Member Avatar for WaltP
0
84
Member Avatar for mhera

Make a C program that will ask the user to input a secret message. Your program will then encrypt and display the cipher text using the encryption formula. Also, to recover the original message, your program should be able to decrypt and display the shift cipher text. Sample Program Interaction: …

Member Avatar for Salem
-2
99
Member Avatar for SecurExpert

Hi guys, Would someone please let me know the difference between these two: [CODE] struct node* branch; // this statement struct node *branch; // && this statement [/CODE] Thanks.

Member Avatar for Ancient Dragon
0
72
Member Avatar for pao+kriz

how about this kind of pyramid? * * * * * * * ** * * * * * * * * * * * * * * * *

Member Avatar for gerard4143
0
59
Member Avatar for miles.85

Hi! I'm working on a compress algorithm. But I couldn't write the software because I don't know how to read and write a file as binary like 101011111111011001. How can I read the like this ? Also I want to ask if I can write the GUI on Java and …

Member Avatar for miles.85
0
159

The End.