15,552 Topics

Member Avatar for
Member Avatar for karthi_selva

hi, i would like to evaluate some value in C. ex [code] #define OK 1 int main() { char *ptr; ptr=(char *)fun(); if(*ptr) printf("SUCCESS"); } [/code] here fun() returns char * and stored in ptr. i would like to check weather ptr is OK or not, i do't like to …

Member Avatar for karthi_selva
0
169
Member Avatar for bleedi

Hey, I've been trying to search for a nice, easy-to-read material about signals in C. So far I haven't found anything that could get through my gray brain mass. My university's material gives only a small surface scratch to the topic, and internetz hasn't been able to tell me much …

Member Avatar for Narue
0
102
Member Avatar for bojomojo

Hello, If I have a text file with the format: Name = MattPhilip Age = 22 how can I use C to read from the file and fill in a structure? Thanks

Member Avatar for bojomojo
-1
144
Member Avatar for mumingazi

hey guys i'm trying to write a code using stacks in C the code should recognize the parenthesis if it closed or opened or not I've done the greater part of the code, but I'm so confused .. I have to submit it after 4 hours .. please I need …

Member Avatar for Nick Evan
0
220
Member Avatar for murtazamzk

hello friends an anyone help me whether one can create a tic-tac-toe game in C

Member Avatar for Jason Giggs
-1
83
Member Avatar for Ahmed Sarwat

Hi,I am trying to scan a string to char *name inside struct data but it gives me segmentation fault. please help thanks. [ICODE]#include <stdio.h> #include <stdlib.h> #include <math.h> #include <ctype.h> #include <string.h> struct data { char *name; }; typedef struct data data; int main(void) { data first; data *fp; fp=&first; …

Member Avatar for Ahmed Sarwat
0
135
Member Avatar for Kamatari

Well, after searching through some old posts here, I found that there were different ways to go about playing general sound effects in C. Can anyone help me figure out how to play sounds in my programs? I'm making them in C ( hence this sub form) and I'm on …

Member Avatar for death_oclock
0
122
Member Avatar for Loc

ok, im clueless.. i need to create a storebot (for buying and selling items) on a game i play called Eternal-Lands.. i dont have a clue where to start.. any help will be much appreciated

Member Avatar for Trepach
0
111
Member Avatar for Snehamathur

It's my First Program using circuar singly linklist [CODE] typedef struct clist { int data; struct clist *next; }CLIST; CLIST *cp = NULL; [/CODE] Add new node function [CODE] void add(int num) { CLIST *r; r = malloc (sizeof (CLIST)); if (!r) { printf("\n\n Not Enough Memory"); return; } r->data …

Member Avatar for Narue
0
112
Member Avatar for gahhon

I wanna ask, How can we reverse a number by using Recursive ? For example if a number is 123, the result will be 321. is that any idea to help me? because i can't think about it... i poor on this chapter.

Member Avatar for myk45
0
195
Member Avatar for Daita

Could we find the largest among three numbers using 'for' and if? I have the following program, please check it #include<stdio.h> main() { int a,b,c,sum=o,i'; printf("enter the numbers"); scanf("%d%d%d",&a,&b,&c); sum=a+b+c; for(i=sum;i<=sum,i--) { if(i==a||i==b||i==c) printf("%d the greatest"); exit(); }}........please clarify the logic if it is correct to the intention..

Member Avatar for Daita
0
144
Member Avatar for rockerjhr

trying to do a program that sums all the even numbers in the sequence but i think im doing it wrong heres my code [CODE]#include <stdio.h> int fib ( int n ); int main ( int argc, char *argv[ ] ) { int i , sum = 0 ; for(i …

Member Avatar for rockerjhr
0
112
Member Avatar for atoklas

The following lines of code output "FFFFFFFF" #include <stdio.h> int main(void) { int i; i=-1; printf("\n%X\n",i); return 0; } This is the 32-bit representation of -1 in Hex. I'm trying to get it to output fewer bits: e.g. 24-bit: FFFFFF In fact, the output I want needs to be 6 …

Member Avatar for Trentacle
0
258
Member Avatar for terabyte

I'm very interested in learning C before C++ but I can't find good books The K&R book looked very organized and short but it seems it is very outdated. So my two questions are.. Should I read the K&R book even thought it uses an old standard, if I do …

Member Avatar for Trentacle
0
179
Member Avatar for gaurav_13191

I have the following code for converting a list of t infix expressions into their postfix form:- [CODE] #include<stdio.h> #include<string.h> #include<ctype.h> #define MAX 400 struct stack { char arr[MAX]; int top; }; void initstack(struct stack *); void push(struct stack *,char); char pop(struct stack *); void convert(struct stack *s,char *); int …

0
80
Member Avatar for dcarrawa

I have a question about embedding Perl scripts in C. I wrote most of the program in C and a portion of it in Perl. As of right now, to call the Perl script I'm using pipe(), fork() and dup2() to create another process and have the Perl application write …

Member Avatar for dcarrawa
0
251
Member Avatar for murtazamzk

#include "Stdio.h" [CODE]main() { int a,b,c; int count = 1; for (b=c=10;a="- FIGURE?, UMKC,XYZHello Folks,\ TFy!QJu ROo TNn(ROo)SLq SLq ULo+\ UHs UJq TNn*RPn/QPbEWS_JSWQAIJO^\ NBELPeHBFHT}TnALVlBLOFAkHFOuFETp\ HCStHAUFAgcEAelclcn^r^r\\tZvYxXy\ T|S~Pn SPm SOn TNn ULo0ULo#ULo-W\ Hq!WFs XDt!" [b+++21]; ) for(; a-- > 64 ; ) putchar ( ++c=='Z' ? c = c/ 9:33^b&1); return 0; …

Member Avatar for Shankye
0
190
Member Avatar for gaurav_13191

I have the following code for Quick Sort procedure: [CODE] #include<stdio.h> void Quick_sort(int *arr,int left,int right); int Partition(int *arr,int left,int right,int pivotindex); int main() { int a[20],n,ctr=0,j=0; printf("\nEnter number of elements:"); scanf("%d",&n); printf("Enter array elements:"); while(ctr<n) { scanf("%d ",&a[ctr]); ctr++; } Quick_sort(a,0,n-1); printf("\nSorted Array:"); while(j<n) { printf("%d ",a[j]); j++; } …

Member Avatar for vinitmittal2008
0
146
Member Avatar for shinsengumi

Hello all. Can anyone here help me create a separate function for the socket() API in socket programming? I successfully created one in Linux before but so far I can't do the same in Windows. The Windows version can't successfully connect using the separate socket() function. My primary suspect is …

Member Avatar for shinsengumi
0
474
Member Avatar for gaurav_13191

Consider the error in following program- [CODE] #include<stdio.h> #include<conio.h> #define MAX 100 struct stacktype { int stack[MAX]; int top; } ; void push(struct stacktype * s,int item) { if(s->top==MAX-1) { printf("Overflow"); return; } s->top++; s->stack[s->top]=item; } int pop(struct stacktype *s) { int item; if(s->top==-1) { printf("UnderFlow"); return -1; } item=s->stack[s->top]; …

Member Avatar for gaurav_13191
0
178
Member Avatar for pinkannu

Hi string copy not working with following code VidZone[Loop].pui8Source = (UINT8 **)malloc(FileCount * sizeof(UINT8 *)); for(FileIndex = 0 ; FileIndex < VidZone[Loop].ui32NoOfSourceFiles ; FileIndex++) { VidZone[Loop].pui8Source[FileIndex] = (UINT8 *)malloc(255 * sizeof(UINT8)); strncpy(VidZone[Loop].pui8Source[FileIndex] , pui8SourceString[FileIndex] , 255); } "pui8Source" is a double poiner and `pui8SourceString[FileIndex]` array of character pointers. Please let …

Member Avatar for pinkannu
0
115
Member Avatar for vedro-compota

Do I understand that by using the following code [CODE] a = getchar(); b = getchar();[/CODE] , after pressing "1" and "Enter" keys ( Enter - to continue programs work), we can derive the following variables - [CODE]a = '1'; b= '\n';[/CODE] thanks in advance))

Member Avatar for vedro-compota
0
94
Member Avatar for vadalaz

I'm supposed to define a function that removes all nodes with a specified value from a linked list. I have to use this structure: [CODE=c] typedef struct LIST { int Object; struct LIST *Next; } LIST; [/CODE] and here is the function I wrote [CODE=c]void LDeleteElem(LIST **List, int Elem) { …

Member Avatar for vadalaz
0
111
Member Avatar for aria12

ok, below is the code that i have tried and still not working; #include <stdio.h> int main () { char Name; int Age; int Date_Of_Birth; float Place_Of_Birth; float Email_Address; printf ("Name:"); scanf ("%c",&Name); printf ("Age:\n"); scanf ("%d",&Age); printf ("Date Of Birth:\n"); scanf ("%d",&Date_Of_Birth); printf ("Place Of Birth:\n"); scanf ("%s",&Place_Of_Birth); printf …

Member Avatar for gerard4143
0
112
Member Avatar for vinitmittal2008

I am using CODEBLOCKS and I am creating a program that performs basic operations like add, delete and insert on Doubly LinkList , My Program is working fine on older Turboc compilers. But when i run it on codeblock its causing problem when i try to delete a node. [CODE] …

Member Avatar for vinitmittal2008
0
217
Member Avatar for amari ♥

i'm new to array. we were given this exercises to be solved: but i have question about [I][COLOR="Green"]letters of ten elements[/COLOR][/I], [I]array integer which is called [COLOR="green"]totals[/COLOR][/I], [I]contents of the character array called [COLOR="green"]words[/COLOR][/I], arrays elements and a lot of stuff that seems to be going with it. thank you. …

Member Avatar for Trentacle
0
127
Member Avatar for bleedi

EDIT: I found the solution already. I had to malloc() memory for rec_msg. :) Hi, I've got a little problem with my (unix) C program. I'm trying to make a HTTP request to fetch a page from a site. I can resolve the IP, make a socket, connect and send …

0
470
Member Avatar for amari ♥

i'm new to array. we were given this exercises to be solved: but i have question about letters of ten elements, array integer which is called totals, contents of the character array called words, arrays elements and a lot of stuff that seems to be going with it. thank you. …

Member Avatar for ravenous
0
109
Member Avatar for shadowscape

[CODE]// Project: XorLib - Xor Encryption Libary. // Copyright: Copyright © 2009-2010 Shadowscape Studios. All Rights Reserved. // Developer: Shadowscape Studios // Website: http://www.shadowscape.co.uk // Support: support@shadowscape.co.uk // Version: 1.0.0.0 // Release: 151220102240 #define export __declspec (dllexport) #include <stdio.h> #include <stdlib.h> #include <string.h> #include <windows.h> long filesize(FILE *f) { long …

Member Avatar for shadowscape
1
761
Member Avatar for Vijay ga

i need some example programs on counter in embedded c for AT89c51 micro controller can u please ..............

Member Avatar for alexchen
0
31

The End.