15,551 Topics

Member Avatar for
Member Avatar for blackcathacker

Yeah, basically I'm asking if anyone could either walk me through a solution of a problem, or if it would be easier to simply do it themselves. I'm "taking" a C class, and would love it if I could get pointed in the right direction with a certain problem. All …

Member Avatar for ddanbe
0
476
Member Avatar for nitish.mohiputlall

(i)Write a function in C Programming Language, isEven(), that takes an integer value as argument and returns 1 if the latter is even, otherwise returns 0 (zero). (ii)The function isEven() is saved to the file 'usefulfunctions.h'. You are required to write a C program that allows the user to enter …

Member Avatar for Ancient Dragon
-1
194
Member Avatar for Tsaou

Hello everyone... I've searched a lot for this but i can't really figure this out. My project consists of 5 .c files and 4 .h headers. all in the same folder. I compile them separately succesfully but when it comes to group compiling (gcc -o progname and all the code …

Member Avatar for Ancient Dragon
0
1K
Member Avatar for Raghuvamshi

Quick sort is a faster way to sort a given array by recursion The algorithm goes like this: it first takes some index element and seperates all elements lesser than this with larger numbers then places this element in right place and does the same thing with all other

Member Avatar for hhhadvani00
0
867
Member Avatar for SerenityG

Hello, I need help with a program that reads in a string, detailing the occurrence of each variable. So far the program reads a string and shows the number of times each variable occurs (letters only). The program is based of keyboard input, so I was wondering if anyone could …

Member Avatar for Ancient Dragon
0
228
Member Avatar for Iamateur

What will be printed as the result of the operation below: #define swap(a,b) a=a+b;b=a-b;a=a-b; void main() { int x=5,y=10; swap(x,y); printf("%d%d",x,y); }

Member Avatar for Helper guy
0
125
Member Avatar for chrispitt
Member Avatar for melonhed85

I'm working on a struct array and I need to dynamically delete elements from the struct. I have the added dynamically but I've run into some issues with deleting. I've researched different methods and tried a few. I found that one from here works, in that it will delete the …

Member Avatar for Schol-R-LEA
0
3K
Member Avatar for ferizhandi

hi all; i have run this code and the first read and write work correctly. but and the second one is missed. the output log is: freez@JALALI:~$ ./a salam8a okok2freez@JALALI:~$ #include <stdio.h> int main() { write(1,"salam",5); char a[2]; char b[5]; read(0,a,2); if(a[0]=='8') {write(1,"ok",2); read(0,b,5); write(1,"ok2",3); } return 0; }

Member Avatar for Schol-R-LEA
0
168
Member Avatar for newbie14

We have a packet capture function which is as below. The issue now each of the hex value of packet I read and concat into a char *hex2Value using this code below. I would like to know is this the most efficienct method to concat all into one single string …

Member Avatar for newbie14
0
240
Member Avatar for fady.a.samy

The mini-supermarket already has a list of product names and their corresponding type (soap, oil, milk, cheese, etc….) included in it initially. The user menu displays the following operations: (Hint: Use the function gets to read an array of characters including spaces) - Insert a product (name, type) - Display …

Member Avatar for jephthah
-1
199
Member Avatar for amrita29april

[code] #include<stdio.h> #include<conio.h> #include<string.h> void main() { char str[80],temp[80],word[20]; int i,j=0,c=0; gets(str); gets(word); strcat(str," "); for(i=0;str[i]!='\0';i++) { if(str[i]!=' ') { temp[j]=str[i]; j++; } else { temp[j]='\0'; if(strcmp(temp,word)==0) c++; } } printf("%d",c); getch(); } [/code] now my problem is that it is counting only the first word.. what's wrong with the …

Member Avatar for jephthah
0
267
Member Avatar for nitin1

can anyone explain me the all precison and exponent, significant bits which double can handle ? i am not getting it. wiki says it has 53 bits significant bits and 11 exponent. am a little bit confused. can anyone explain me ? (in their own way) thanks alot. although i …

Member Avatar for jephthah
0
161
Member Avatar for fafa70

hi. i create a server and client and i have a text based connection between them. firstly client sends a message to server and client gets the answer but after that client sends another message to server and when client wants to get the message, it shows empty message. important …

0
100
Member Avatar for fafa70

hi. i have problem with following code: when i give address directly it works correct but when i get address from command line, it does n't work. int main(int argc, char** argv) { int size; int fd,fd2; char buf[10000],buf2[10000],FileAdd[10000]; size = read(fd2,buf2,10000); //char *FileAdd = malloc(size); strcpy(FileAdd,buf2); if ((fd= open(FileAdd, …

Member Avatar for fafa70
0
317
Member Avatar for ronnelayson

Please help me with this code. when i tried to run it, it doesn't continue to this part "printf("\n\n Money: ");" but when i tried to change the data type of money to integer it does continue, but i need a float data type. please help, thank you. #include<stdio.h> #include<conio.h> …

Member Avatar for ronnelayson
0
108
Member Avatar for prathiyus

im trying to send image from one system to another(client server model),it works fine when i use loopback ip address(same machine as both client and server) but when trying to send to another system,the gimp doesnt recognize the image and displays an error after receiving the image... here is the …

Member Avatar for prathiyus
0
5K
Member Avatar for Babymonkeystuff

**I am trying to read the records from and to a CSV file in C. Of course i want to stop when I have read all the records. If I use a for loop it works perfect except I have to know how many records there are. if I change …

Member Avatar for rubberman
0
4K
Member Avatar for nitin1

can you tell me the approach that i have k*n nodes where k,n are integers and no two adjacent nodes can have same colours and i want to colour the trees with n colours. (i am making trees not graphs.) thanks. any help will be appreciated.

Member Avatar for nitin1
0
69
Member Avatar for Drgy55

Please read this whole post before commenting. I am new to programming in C. The problem I have is from Kochan's "Programming in C," Chapter 6, Exercise 6. The problem states that I need to take user input (some integer) and display it in english. Ex. User inputs "123", output …

Member Avatar for Moschops
0
273
Member Avatar for johans22

#include <iostream> typedef struct _test { int a; int b; int c; }test; test sArray1[]= { {10,2,3}, {3,9,0}, {90,56,82}, {7,8,2} }; test sArray2[]= { {10,12,32}, {13,99,40} }; *//i need to initialize sArray as:* test sArray[]={//how?. is this possible?. sArray1 sArray2 }; int main(int argc, char* argv[]) { *//in here be …

Member Avatar for johans22
0
120
Member Avatar for sai.aleenus

#include<stdio.h> #include<conio.h> int main() { float fill_h[400],fill_s[400],bh_p[400],ex_up,ex_upt; int i,j,p;float lam = 0.5; float fhf = 1.8288 , fhi = 0.6096 , fsi = 12.0f , fsf = 19.0f ; fill_s[0] = fsf;fill_h[0] = fhi;bh_p[0] = bhpeqns(fhi,fsf); for(i=1 ; lam > 0.002 ;i++) { printf("\n the loop is run"); if(fill_h[i-1] == …

Member Avatar for sai.aleenus
0
137
Member Avatar for bazingatheory

hi i am really new to this and can't see why i can't get my code to work, it is probily really silly but help would be appreciated. i am trying to get the user to enter the number of competators of a 4 lap race so that it can …

Member Avatar for Moschops
0
342
Member Avatar for sushants
Member Avatar for Banfa
0
161
Member Avatar for sujinsr

int xml_validation(char *xsd_file, char *xml_file) { xmlDocPtr doc; xmlSchemaPtr schema = NULL; xmlSchemaParserCtxtPtr ctxt; char *temp_buf = malloc((strlen(xml_file)+1) * sizeof(char)); char *XMLFileName = malloc((strlen(xml_file)+1) * sizeof(char)); char *XSDFileName = malloc((strlen(xsd_file)+1) * sizeof(char)); strcpy(XMLFileName, xml_file); strcpy(XSDFileName, xsd_file); xmlLineNumbersDefault(1); ctxt = xmlSchemaNewParserCtxt(XSDFileName); xmlSchemaSetParserErrors(ctxt, (xmlSchemaValidityErrorFunc) fprintf, (xmlSchemaValidityWarningFunc) fprintf, stderr); schema = xmlSchemaParse(ctxt); xmlSchemaFreeParserCtxt(ctxt); …

Member Avatar for sujinsr
0
487
Member Avatar for sparkling eyes

Hi...I have to bulit code for a parser in c++ which takes a simple txt file in which there are two functions 1 is for addtion of two numbers and 2nd is for printing of result. Parser have to open the file read it line by line and then tell …

Member Avatar for ddanbe
0
151
Member Avatar for johans22

given struct s={int A; int B}; what is most logical and fastest way to find the B element given A in this array or vice versa?. s table1[]={{1,2},{3,4},{5,6},..};

Member Avatar for johans22
0
139
Member Avatar for jose.a.rueda.5

Hi, I have this program in C that prints me a right character triangle but I created it in a way that it asks me for the number of rows I want to print, but what I actually want to insert is the letter that I want at the bottom, …

Member Avatar for tinstaafl
0
134
Member Avatar for Yustme

Hi everybody, I'm new in programming. Getting started with C. Im trying to do a few easy things like to uppercase a string. But i got stuck... This is what i have so far: [code] void toupper( char *text ) { char c[] = "testING"; } [/code] And im not …

Member Avatar for brcsur
0
9K
Member Avatar for harishjoy

What does one mean when they say a particular folder should go as **win32 release** for production?

Member Avatar for harishjoy
0
101

The End.