15,547 Topics

Member Avatar for
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
167
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
313
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
3K
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
272
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
118
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
136
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
332
Member Avatar for sushants
Member Avatar for Banfa
0
160
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
485
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
133
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
98
Member Avatar for harishjoy

Hi Team, I have 2 questions: 1. If I create a DLL using VS 2005 for my application and then use the same DLL in some other machine which has vs 2005 redistibutables, it should work right? Please confirm. 2. I get debug assertion failed on a DLL. What could …

Member Avatar for harishjoy
0
292
Member Avatar for jose.a.rueda.5

hi! i have a program in C++ that produces a right triangle of character and i need the same program, i mean a program that makes the same function, but in C. This is my program in C++ : #include <iostream> using namespace std; int main() { int i,j; char …

Member Avatar for mridul.ahuja
0
231
Member Avatar for dancks

I'm having trouble with a binary tree algorithm. A test program I wrote calls for the top node to only be altered in another method outside main (A simple guessing/learning game scenario). I wrote a smaller test of that exercise here: #include <stdlib.h> #include <stdio.h> #include <time.h> struct binary { …

Member Avatar for dancks
0
280
Member Avatar for sujinsr

I having soap request and response xml in seperate file. i need to parse it and get the data from soap xml file. using C program I know it is possible with libxml2. Is it there any other way to parse ? Is there any facility available in gsoap to …

Member Avatar for sujinsr
0
964

The End.