18,490 Topics

Member Avatar for
Member Avatar for potato4610

C Program - Write main and two other functions named ComputeMaximum and ComputeMinimum that return the larger and smaller, respectively, of two type double arguments: 1. Each function must be in a separate file. 2. The files containing ComputeMaximum and ComputeMinimum may not contain #defines, #includes, if statements, switch statements, …

Member Avatar for kings_mitra
0
220
Member Avatar for sree_ec

Hi, How to find the stack size available for main thread in a program(which contains the main() function) In the case of linux, we can specify the stack size available for the whole program in linker script during linking. For all other threads, we can specify the stack size when …

Member Avatar for Ancient Dragon
0
613
Member Avatar for Member #800943

I can't seem to pass a struct address to a function. My program "stops working" when it gets to the scanf statement of the getReady function. [CODE]/**************************************************** Author: ---------------------------------------------------------------------- Purpose: This code will explore passing a data structure address to a function. ****************************************************/ #include <stdio> #include <stdlib> //prototypes: struct things{ …

Member Avatar for Member #800943
0
159
Member Avatar for rje7

I want to arrange the number 1 - 12 like shown below. like the numbers on the clock. [code] 12 11 1 10 2 9 3 8 4 7 5 6 [/code] arrived with the following code: [code=c] #include<stdio.h> int main(){ int e = 11; int count = 10; int …

Member Avatar for Adak
0
135
Member Avatar for rajwant51

:confused: friends can you give any idea about making screensaver in c language:

Member Avatar for karthik_udt
0
277
Member Avatar for lionaneesh

[CODE]/* A simple server in the internet domain using TCP The port number is passed as an argument */ #include <stdio.h> #include <sys/types.h> #include <sys/socket.h> #include <netinet/in.h> #include<arpa/inet.h> #include<netdb.h> #include<string.h> int main(int argc, char *argv[]) { struct addrinfo hints,*serv,*p; int sockfd,newfd,status; struct sockaddr_storage their_addr; socklen_t addr_size; char *msg; int len; …

Member Avatar for malathi renin
-1
154
Member Avatar for imavp2

Hi Everyone! Wow, when I received the invite that stated Daniweb is the friendliest IT Forum on the web, I can attest that this is certainly true. A little bit about me (and there is not much), I studied SQL 2000 and became Microsoft certified literally 10 years ago. I …

Member Avatar for maceman
0
219
Member Avatar for atechnikality

I'm a student and taking an intro to C class and would appreciate some help! I've got a file with 10 words that I've loaded into a 2D array. I've written code that will generate a random number between 0 and 9 to select a string from the array. I'm …

Member Avatar for atechnikality
0
1K
Member Avatar for ganav

Hello! I want to make a simple game like this: [IMG]http://img340.imageshack.us/img340/6393/gamea.jpg[/IMG] So I need to start by moving the rectangles. Now I want to make an option for player VS player. I need to somehow check what keys are in "key down" state. How can I do that? (I'm using …

Member Avatar for Adak
0
119
Member Avatar for libathos

hi guys, so iam writing a program which creates a .bat file in a directory and copies it to another directory through copyfile...the problem is that while the .bat file is created properly but when it's copied to the other directory an error occurs saying its not a win32 appropriate …

Member Avatar for libathos
0
166
Member Avatar for alvaradoxon

im a computer course student and needs help about the program using loop and gotoxy. Where in we have to create a program that will display the image below. * ** *** **** ***** NOTE: The program will accept a value (an integer) for the length of the triangle. (The …

Member Avatar for AuburnMathTutor
-1
231
Member Avatar for pavani2006

i want to print words in reverse. i could print characters in reverse but not words for(int i=arr.length;i>0;i--) printf(arr[i]);

Member Avatar for devaru2003
0
246
Member Avatar for sabareesh

I created a dyanamic array through malloc() function. (size is 1024) next time i want to change buffersize as 500 . how can do this?

Member Avatar for sabareesh
0
111
Member Avatar for gahhon

brothers, please teach me how to show error message when a user input non-character type value? i try myself while i use if statement, but it will show me the error message too when type character type or string type. [CODE] if(name > 0) { system("cls"); printf("\t\t============\n"); printf("\t\t ALERT! \n"); …

Member Avatar for gahhon
0
183
Member Avatar for gmunk

Hi all, lets say for example I have the following code [CODE]char *fname = "John"; char *lname = "Doe"; char *query = "SELECT fname, lname FROM table_name;"[/CODE] The last statement won't work, so my question is how to pass the fname and lname variables to the query?

Member Avatar for aryan79
0
1K
Member Avatar for ellenski

Hi, We were asked to make a Binary Search Tree program in C. It should be able to traverse the numbers (preorder, inorder, postorder) then display it. And locate the number and display it. I have no probleming traversing and locating it. My problem is if the number isn't there …

Member Avatar for ellenski
0
125
Member Avatar for ellenski

Hi, We were asked to make a Binary Search Tree program in C. It should be able to traverse the numbers (preorder, inorder, postorder) then display it. And locate the number and display it. I have no probleming traversing and locating it. My problem is if the number isn't there …

Member Avatar for ellenski
0
134
Member Avatar for jbronen

Hey, I'm writing a program that takes files and renames them to include a timestamp of the current time on them in c++. I'm pretty new to c++ (and programming in general) and any help or advice would be greatly appreciated. So far I have this: When I compile it …

Member Avatar for jbronen
0
1K
Member Avatar for okwy

Good day all, I have this problem and have have spent quite a huge amount of time on it without any considerable progress. My problem is stated thus: I have a series of files with the extension (.msr), they contain measured numerical values of more that ten parameters which ranges …

Member Avatar for kings_mitra
0
131
Member Avatar for bunty_kkp

1. Define a structure called cricket that will describe the following information Player name Team name Batting average Using cricket, declare an array player with 10 elements and write a program to read the information about all the 10 players and print a team wise list containing names of players …

Member Avatar for Nick Evan
0
313
Member Avatar for daudiam

b=c/d++; In this, first d is incremented (because ++ has a higher priority than / or =), but c is divided by the unincremented value of d. Thus, the order of evaluation in this case is well-defined. But if we had written the above as: b=(c)/(d++) then which operand ( …

Member Avatar for daudiam
0
302
Member Avatar for westony

Can you help me to start with them I cant find any information about them the exactly thing i need its Array of pointers where the pointers are pointing a menu like this idea below. Pls just help me with the syntax ...

Member Avatar for kings_mitra
0
105
Member Avatar for ITereza

Hallo all! My name is Tereza, Im 14 and live in Denmark. Rigth now Im about to learn some C and C++, but then I had some problems which I googled. I found this webside and it really helped me, and so I became member :) I have been programming …

Member Avatar for keyboardboy1
0
196
Member Avatar for tehb

As I know that .c is the extension format for c coding while cpp is the extension for c++. But I noticed that there are some c++ project use .c extension instead of cpp, is it both extension is supported in c++ compiler?

Member Avatar for tehb
0
297
Member Avatar for Ray007

How to do this structures, any Idea? Given a program segment as follows: #include <stdio.h> struct book { char title[80]; int bar_code; float price; } ; struct book BOOK; void INPUT (struct book *B); float DISCOUNT (struct book *B); You are required to write a complete program that includes the …

Member Avatar for farahlyna
0
128
Member Avatar for george61

Pretty interesting problem about linked list. This program is about autobuses. Each autobus is given by brand, registration number, number of seats, kilometres and year when the bus was made. The program is organised as menu and when you hit number it calls some function. Problematic function: it should NOT …

Member Avatar for george61
0
125
Member Avatar for saiful_911

plz help me to solve the below problem.i have done some code. MY client and server need to achieve the following requirements: 1.1. program for client needs to take two arguments that specify the name of server and the port that it is trying to connect to. Your program for …

0
74
Member Avatar for heena sharma

how to reverse a string in character array without using string functions...

Member Avatar for Fbody
0
158
Member Avatar for NH1

I have an issue i need to get resolved fast. I cant seem to get my Dialog box to run properly. This is the code i have for it. The Problems i have are where the black arrows are. First arrow: "No matching prototype available Second and third arrow: "Invalid …

Member Avatar for Riebens
0
192
Member Avatar for alphahr

Does anyone know where I can find a subroutine library for the little PIC12F508/509? I have searched the web and either missed it or couldn't find it. I am just now starting back into PIC's and have a series of PIC12 and PIC16 chips, development boards and a large assortment …

0
75
Member Avatar for raymondf

[CODE]void deletenode(NODE* node,int no){ if(node==NULL) return; else{ if(node->data==no){ if(node->left!=NULL && node->right==NULL) { printf("%d ",node->data); node=node->left; printf("%d ",node->data);} else if(node->left==NULL && node->right!=NULL) node=node->right; else if(node->left==NULL && node->right==NULL) node=NULL; } deletenode(node->left,no); deletenode(node->right,no); } } [/CODE] can anybody tell me what's wrong with my code? it's suppose to delete a node of a …

0
44
Member Avatar for angelinrajeesha

Hi, Is it possible to allocate memory using malloc() (C) and release it using delete (C++) or even the opposite Alocate with new (C++) and release with free() (C) If not Why?

Member Avatar for mrnutty
0
154
Member Avatar for evinkeating

I have a program that works fine under windows, but when i run it on Unix I get a very slightly diffent set of results, followed by a 'segmentation fault' message. I'm at a loss to explain why. Any ideas?

Member Avatar for evinkeating
0
919
Member Avatar for evinkeating

I've a 2-d array declared as such [CODE]lower_tri = (float **)malloc(sizeof(float *)*(dimention)); for(i =0; i < dimention; ++i) lower_tri[i] = (float *)malloc(sizeof(float)*(i+1));[/CODE] So that it looks like... [] [][] [][][] [][][][] ... However, it causes a segmentation fault when I try to de-allocate the array with [CODE]free(lower_tri);[/CODE] (only in unix, …

Member Avatar for Ancient Dragon
0
240
Member Avatar for CodeAerial

Ok, just as my topic says, I'm having trouble why it cannot consider negative multipliers. Code below: [CODE]//Multiplication by Repeated addition #include<stdio.h> main() { int k, l, m, n; printf("Enter Multiplicand: "); scanf("%d", &k); printf("Enter Multiplier: "); scanf("%d",&l); n=0; for(m=0;m<l;m++){ n=n+k; } printf("Result is: %d", n); printf("\nThank you for using …

Member Avatar for Liyaan
0
1K
Member Avatar for dgrandfromage

I want help in writing a C function that allows me to print a particular line in a text file. Is there a way to skip lines in a text file??

Member Avatar for kings_mitra
0
72
Member Avatar for bops

Hello. I am having a little trouble with enabling and disabling word wrapping in a normal edit control. [CODE] hEdit = CreateWindowEx(WS_EX_CLIENTEDGE, "EDIT", "", WS_CHILD | WS_VISIBLE | WS_VSCROLL | WS_HSCROLL | ES_MULTILINE | ES_AUTOVSCROLL | ES_AUTOHSCROLL, 0, 0, 100, 100, hwnd, NULL, GetModuleHandle(NULL), NULL); // This is how my …

0
119
Member Avatar for KSGuan

Hello, I'm just a beginner (student). Now still undergo C programming class to upgrade my knowledge in C. I was asked to complete a simple program to get the output of C program in the text file as shown below. This program is to help user to consider a range …

Member Avatar for codewriter_IND
0
150
Member Avatar for shanbady

Greetings, i am pretty new to C (a few weeks experience)and i can program some complex programs and small database apps yet i don't know how to program guis in C. Are there any tutorials to program guis for windows in C? (not C++). many thanx if u cn find …

Member Avatar for Nick Evan
0
175
Member Avatar for tennis

If I declared a static variable in a header file, and the header file is included in a couple of .c files. Is there any problem? Thanks

Member Avatar for Nick Evan
0
105
Member Avatar for Fasola

In my old C++ programming classes I would often trip up on theses basic concepts when things got more and more complicated: 1. Arrays 2. Functions 3. Inheritance 4. Call by Reference 5. Call by Value 6. Pointers I kind of know how they work but don't really know what …

Member Avatar for A.Rehman Amjad
0
1K
Member Avatar for KV305

Hey guys im having trouble completing this C program. Its suppose to ask the user to enter a file to read from, read the file, count how many times each word appears and print the results in a different file(also user input) arranged from high occurrence. Heres what i have …

Member Avatar for Adak
0
137
Member Avatar for m7r23

Hi, I can find the largest number. But I can not find the second largest number. I dont know where to start.

Member Avatar for jeevsmyd
0
231
Member Avatar for george_82

I am new to image processing and can u please help me to convert a GIF image into binary using C programming.

Member Avatar for science.seeker
0
2K
Member Avatar for tennis

If I declared a static variable in a header file, and the header file is included in a couple of .c files. Is there any problem? Thanks

Member Avatar for mike_2000_17
0
205
Member Avatar for KV305

Hey guys im having trouble completing this C program. Its suppose to ask the user to enter a file to read from, read the file, count how many times each word appears and print the results in a different file(also user input) arranged from high occurrence. Heres what i have …

Member Avatar for vegaseat
0
117
Member Avatar for danswater

Hi guys! I just wanna ask on how to access the first character in a string?

Member Avatar for danswater
0
129
Member Avatar for chade25

First let me say, please don't post code back all fixed. If you see where the error is, just tell me where it is and I will look to find it. Thanks, much appreciated! [CODE] /* void processCmdLine(void) Function: parses the command line using gettok(), and constructs an argument list. …

Member Avatar for chade25
0
149
Member Avatar for Jamesbch

Hello everyone, I find C not very flexible this time because I know there is an easy way to assign field values to a struct like this : [CODE]Struct mine = { field1, field2, ... };[/CODE] but in my case "mine" is contained in a bigger struct. So I have …

Member Avatar for Adak
0
171
Member Avatar for aea414

Hello all, I think am having problem getting the add_to_list function below to work. I created it so that it accepts a pointer to a linked list, a pointer to a char array (string) and a number for occurrence of the word. [CODE] #include <stdio.h> #include <stdlib.h> #include <string.h> #include …

Member Avatar for aea414
0
231

The End.