15,551 Topics

Member Avatar for
Member Avatar for taikoprogrammer

Hi everyone, So I am writing this program that is supposed to do the following: Create a program that accepts a string from the user (not from the command line) and displays: 1. The string using upper-case letters, e.g. all lower-case letters are converted to upper-case letters 2. The string …

Member Avatar for yellowSnow
0
4K
Member Avatar for katwalatapan

Hello, Could anyone assist me in starting out with pointers. I know that pointers direct to the memory location where a value is stored, but I am having some issues with understanding the concept with arrays. Could you suggest a simple startup code, where a pointer points to a memory …

Member Avatar for Tom Gunn
0
114
Member Avatar for shaju_nitk

Hi, Need help to write the below mentioned program. Create an employee struct with following fields EMP_NAME EMP_ID DOJ (Date of joining) Read in the values from a file and store them in the above structure. Print the employee details if an EMP_ID is given. Regards, Shaju

Member Avatar for yellowSnow
0
233
Member Avatar for nandakv4

hello, i am trying to store some values in an array dynamically. doing this as i dont want to over allocate memory to my array. so the code goes as follows:: [code] #include<stdio.h> #include<stdlib.h> int *p; main() { int i; for(i=1;i<6;i++) { p= (int *)malloc(sizeof(int)); *p++ = i*i; } printf("\n …

Member Avatar for nandakv4
0
90
Member Avatar for forestwwq

I write a small program like following: 1, firstly create a process waiting for keyboard input commands(via getchar()). 2, secondly create a thread in the process waiting on a message queue. each time after the thread receive a message, it can handle the message but cannot print the log message(via …

Member Avatar for frk
0
335
Member Avatar for Salem

This is a catalogue of some experiments on just two aspects of undefined behaviour. This was inspired by yet another long bout of explanation in a recent thread, so I thought it was time to dust off a bunch of compilers, and compare. This is the test code. [code] #include …

Member Avatar for frk
4
581
Member Avatar for muusa

this is the code #include<stdio.h> void main() { int i; printf("%d, %d",++i,i++); } and following is the output 8429558, 8429556

Member Avatar for muusa
0
116
Member Avatar for RobBrown

Hello, i can not quite figure out how to write a function to take numbers from an array and sort so it displays even numbers first and then odd numbers. the output should look like this: [QUOTE]Original: 9 8 7 6 5 4 3 2 1 Reversed: 1 2 3 …

Member Avatar for Tom Gunn
0
137
Member Avatar for user98

I'm a .net programmer so forgive me if this is a stupid question, but here goes. I'm working with a vendor to interface our system with theirs. We are sending text data via modem. The protocol specifications they have given us require a checksum value to be appended to the …

Member Avatar for Salem
0
288
Member Avatar for duggydiggy

After going through lots of stuff about declaration and definition,in a nutshell I understand that the difference is in the memory allocation. In definition yes and in declaration no memory is allocated. Fine ,Is there any process that shows that yes [code] int a; //which is a definition [/code] allocates …

Member Avatar for Salem
0
199
Member Avatar for taikoprogrammer

Hi Everyone, I am having some trouble with the code I am writing. I am supposed to find the sum all ASCII codes in the string, omitting the newline character at the end of the user input. Here are the directions I am given: Create a program that accepts a …

Member Avatar for wildgoose
0
905
Member Avatar for Alibeg

Hi guys....i have a problem and I hope you can explain me where am I wrong... I am doing some kind of Breadth First Search (BFS) ("some kind of" because this is my first program to use this algorithm) I have an array of size 4^9 (262144 for those of …

Member Avatar for Alibeg
0
180
Member Avatar for Lioshenka

Hi, I already asked but haven't had an answer. What I am trying to do is to write a program which will read the data from the file into BST with the ability to search by surname (surname is the key). After sleepless nights I have managed to do something, …

Member Avatar for Tom Gunn
0
68
Member Avatar for alvalany

When i was runnning the graphucs c program in turbo c the program was terminated. I gives an error message as 16-bit MS DOS subsystem The NTVDM CPU has encountered an illegal instruction. CS:d000 IP:03e2 OP:ff ff eb 05 ea Please provide me the solution I also tried using dosbox.. …

Member Avatar for alvalany
0
201
Member Avatar for duggydiggy

Hi, This is a basic question that's why i am confused. When I do printf("%d",sizeof(long double)) in Linux(i am using a vmware) Ans:12 bytes in msvc 2008 Ans:8 bytes My underlying arch for both implementation is intel IA32. What is the reason if the arch is same.If the fundamental data …

Member Avatar for Salem
0
86
Member Avatar for wizkids157

Hi, I've just started using Netbeans 6.5.1, and I was wondering if you can run a single C file independently of the other C files in the project. This works for java. For example, you can run test1.java and test2.java independently in the same Java project. But it doesn't seem …

0
55
Member Avatar for mevanga

Can someone help me to write a code in C Programming that will ask the user to enter a PIN and if the PIN is entered 3 times wrongly the program should exit. Thanx in advance.......

Member Avatar for mevanga
0
122
Member Avatar for no1zson

I am new to C programming and have been using the GOTO all over the place until today when I was informed it is not preferred practice, and due to its adverse affects on debugging and maintenance should only be used in the rarest of cases. I can understand that …

Member Avatar for hket89
0
149
Member Avatar for hket89

/* File: Kilowatt-hours.c Calculate and print bills for the city company.*/ #include <stdio.h> int main() { int account_number; char code; double bills, kilowatt_hours, peak_hours, off_peak_hours; printf("Please enter Your account number: \n"); scanf("%d", &account_number); printf("Enter Your user code [R/C/I]: \n"); printf("R = Residential\n"); printf("C = Commercial\n"); printf("I = Industrial\n"); printf("\nCode = …

Member Avatar for DangerDev
0
267
Member Avatar for revenge2

hey guys how would i figure out if a string has a number in it without using any aditional libraries?

Member Avatar for Hiroshe
0
4K
Member Avatar for lecotti

Hello, having a bit of trouble with this. I am writing a program which sorts a sequence of numbers using a binary tree however i cannot to seem to get it to work; i belive it is something to do with passing the digits to makenode(). Any help would be …

Member Avatar for lecotti
0
92
Member Avatar for yasaswyg

Can anyone tell me whats wrong with the code. I get two errors. I dont know how to fix it [code] #include<stdio.h> typedef struct { int i; float f; } STR; void fun(FILE*, int); void main() { STR* sp; int x; printf("Enter number of record to be printed: "); scanf("%d", …

Member Avatar for wildgoose
-1
93
Member Avatar for yasaswyg

I need to write a function that traverses a general list and deletes all nodes that are after a node with a negative key. But I dont know where to start so can I get some help

Member Avatar for yasaswyg
-1
119
Member Avatar for des6043

what's wrong about this? why when i compile,it come out expected primary-expression? what is that? [code=c] #include<stdio.h> #include<conio.h> main() { float Lab,Mid,Pro,Quiz,Final,Total; printf("\nEnter your mark for Lab:"); scanf("%f",&Lab); printf("\nEnter your mark for Mid Exam:"); scanf("%f",&Mid); printf("\nEnter your mark for Quiz:"); scanf("%f",&Quiz); printf("\nEnter your mark for Project:"); scanf("%f",&Pro); printf("\nEnter your mark …

Member Avatar for des6043
0
156
Member Avatar for patrick k

Hey everybody, I was trying to create a program that simulated the game "Mastermind" using numbers 0-5 instead of the six colored pegs. I have written out the code, and it seems to work, all except for the loop I have set to see if the user wants to play …

Member Avatar for Hiroshe
0
227
Member Avatar for guyod

Hello, I am learning C, POSIX, and Unix. I am trying to write a code that wait until the child process is done then terminate, however, I do not know what to put in the while loop. [CODE] Parent function: signal(SIGCHLD, handler) while(child process is running) print the number of …

Member Avatar for guyod
0
166
Member Avatar for DoEds

In this program i want to ask the cashier if the customer wants to buy anything else. Typically, Ask customer what beef product he wants to buy. Ex. 1 //Chicken Liver Ask customer how many kilo(s) he will buy. Ex. 2 //2kg (problem) Then ask the customer if he wants …

Member Avatar for abhi.navale
0
467
Member Avatar for NRaf

*sigh* Malloc get's me every time... Basically what I'm trying to do is read data from a file to populate a square array on integers. I'm declaring the array as 'int** matrix' in main(). I pass this to the function which handles reading the file (the parameter for the function …

Member Avatar for Dave Sinkula
0
87
Member Avatar for yasaswyg

This is a short summary of my project make two text files with random stuff in it and then make them into bin files and then merge them into one and u take two text files and combine into one text file the code is pretty damn long #include <stdio.h> …

Member Avatar for Hiroshe
0
145
Member Avatar for yasaswyg

this code takes out the spaces in between and i want to shrink this code a bit. like in function modify. It doesnt work if i take out the `if(s[i] == ' ')` I want to make this code work without using that. Any help?? #include<stdio.h> #include<stdlib.h> char* modify(char*); void …

Member Avatar for wildgoose
0
81

The End.