15,552 Topics

Member Avatar for
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
560
Member Avatar for garyengle

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 garyengle
0
141
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
101
Member Avatar for rajwant51

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

Member Avatar for karthik_udt
0
256
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
138
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
104
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
142
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
217
Member Avatar for fsl4faisal

[CODE] #include<stdio.h> #include<conio.h> #include<stdio.h> void maketree(struct node**); void inorder(struct node**); struct node{ struct node *left; struct node *right; int data; } void main() { struct node *root; root=NULL; printf("Enter root"); maketree(&root); preorder(&root); getch(); } void maketree(struct node **root) { int num; struct node *temp; if(*root==NULL){ //printf("Enter number"); scanf("%d",&num); temp=(struct node*)malloc(sizeof(struct …

Member Avatar for gusano79
0
163
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
89
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
149
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
108
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
121
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
676
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
118
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
239
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
239
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
82
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
106
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
104
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
63
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
179
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
31
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
884
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
205
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
59
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
97

The End.