15,551 Topics
| |
the problem with this is that after it accepts the four (4) integers it stop and dont go on to find the average. IS THERE ANYONE OUT THERE THAT CAN HELP. NUFF RESPECT TO ALL WHO TRY TO HELP. [code=c] //to calculate the average of 4 numbers #include<stdio.h> int get4ints(){//function … | |
Hi there, I am trying to make a piece of code in C that: 1. opens a specified file, 2. Reads the data in the file and separates it into two arrays, based on the position of commas, 3. Converts the strings into doubles and then perfoms some manipulation on … | |
I mean I can change [code] double d; d= atof("99.0"); [/code] this with %.2f to ---- 99.0 to 99.00 but how can I take from user an integer and change it %.2f??? what should I write in atof ???? anyone to understand ??? :) | |
I'm trying to make a simple IM program. I created a server and client that connects specifically to my computer using Winsock2.h I tested it and it works from my computer to my server, from my roommates computer to my server, the library computer to my server, but I had … | |
Hi all. This is my first post here, and i need urgent help with a programming assignment. I am working on an assignment which requires me to build a simple shell. My shell must handle simple commands with arguements and ones with piping and I/O redirection. The problem is i … | |
i need ur help to complete this assignment Write a C program which, reads from standard input, replaces all the occurrences of the characters supplied by the 1st command line argument, with the corresponding characters supplied by the 2nd command line argument, and writes the output to a file supplied … | |
Hi In the main I have declared a variable char string[100]; I need to construct this variable with a function and I have written the code: [code]char stringReceived(int sockDesc){ char unsigned c; char tmp[100] = " "; int i=0; int n; do { n = recv(sockDesc, &c, 1, 0); // … | |
Hi During writing a code, I need to define dynamic arrays several times, so I wrote the following simple function for defining a double 1D array: [code=c] /*---------------------------------------------------------------------------- Function for Difining 1-D Dynaimcs Arrays for Storing Double Values ------------------------------------------------------------------------------*/ double *allocation_1d_double(int size) { double *array; if ( (array = (double … | |
Hi all, I have faced some problem ina coding. What I have to do is just to replace all "big" with "small" from the string " The world is big. there are big cities. Bigger city mean bigger population. Towns are getting smaller". My code is [code=c] #include<stdlib.h> #include<stdio.h> #include<string.h> … | |
Hi I've just picked up a copy of SAMS teach yourself C in 21 days (I dont think Ill finish it that quickly) because I wanted to get into programming. I've worked through the first chapter, but keep enountering a problem: my programs exit before I can see what they … | |
Can somebody tell/show the example to me on how to declare struct in the class and to use this struct in object oriented environment effectively. | |
hey guyz, i'm trying to search each ar for matching characters in the buff, but I seem to be getting a buffer overflow. Can anyone give me any pointers, any help would be appreciated, this is my code: [code] #include <stdio.h> #include<stdlib.h> #include <unistd.h> #include <fcntl.h> #include <string.h> main(int ab, … | |
I have a csv file that I need to be able to read it into a struct array. I have read examples and they all match what I have. [code] [COLOR=#0000ff]void[/COLOR][COLOR=#000000] ReadStudents ()[/COLOR] { fstream infile; [COLOR=#0000ff]int[/COLOR] i; infile.open ("c:\\students.txt"); [COLOR=#0000ff]for[/COLOR] (i =0; i < 20; i++) { infile >> … | |
Hi to all, In my little server program, I have this code: [code]i=0; charRecv = recv(nSocketDesc, &c, 1, 0); while (c !='\n') { mystring[i++]=c; charRecv = recv(nSocketDesc, &c, 1, 0); } // End while (c !='\n') mystring[i]='\0';[/code] 'c' are a sequence of char sended to server from a client and … | |
Ok, so I know lots of people have posted about how to find prime numbers up to a certain number, and I can do that, however If I wanted to output a certain number of prime numbers so that the user inputs say 6, it would out put 2, 3, … | |
I need help verifing. If you need more information let me know, but I am a beginner. Just need help with the verifyValue.cpp what kind of code or functions would you suggest. Thanks [COLOR=#000000]In options 1 and 2, the user will input the ID, Type, Description, Quantity on Hand, and … | |
[COLOR=#000000]Hey guyz, I'm stuck with this given, its bit hard I cant understand it just wonna know the logic ( no codes).[/COLOR] [COLOR=#000000] [/COLOR] [COLOR=#000000]Its saying write a C program which read from standard input, replaces all the occurrences of the characters by the first command line argument, with the … | |
the problem is as follows: write a program:the array of integers indicating the marks of the students is given.u have to calculate the percentile of the student according to this rule:the percentile of a student is the % of number of student having marks less than him.for example: student marks … | |
Hey, Is there any equivalent of conio.h for Linux??? I basically want getche to work in linux.. Is there any alternate?? | |
[COLOR=#000000]C program to create a calculator. The program will accept an arithmetic expression (assumed to be valid expression of only +, -, *, /, 1/x, and % operations) from the user. Evaluate the expression and display the results. Including the above functions, this calculate should provide the temporary buffer (memory … | |
hi i'm student in university i try to do my homework to simulate FCFS and RR i need ur help to tell me if my answer good or :sad: Qustion is: the project is to write a program to simulate FCFS and RR without having any i/o, all processes have … | |
I am attempting to search a list to check whether an item is already present before inserting. I am having trouble with the pointers; I understand that I need to set the pointer to the start of list but I keep getting compilation errors. Can anyone help? Here is my … | |
i've been given an assignment to writet he coding for a calculator. more the functions,higher the score in the assignment! i'll use the switch statement nd read through math.h. wat other suggestions can u guys giv me??there isnt' any limit to the no. of inputs we can take! can ny1 … | |
Hello all I'm a fresher to Microcontroller programming. I have defined certain global variables that I need to store at consecutive memory locations, say starting from 0x8000h . Will appreciate if anyone can give me the syntax / instructions to go about the same. thanks techie | |
i tried writing a program whose output would display the letter p in a (3 by 12) that is 3 rows and 12 columns, didnot succeed. could you help me | |
For some reason, newline characters seem to be using 2 bytes in text files instead of one. Is this normal? When I open a text file and look at the size, I get one more for every character I add, except for newlines, which add 2 bytes. | |
:rolleyes: I need some one to define prime numbers for me A full definition, I am trying to write a program to determine wether a number is prime, print all prime numbers in a specific range ... e.t.c so i need a full definition of prime numbers, i know prime … | |
I've posted my C code below for a card game (yep, i'm still on it). Now the neg() function is called from the turn() function. so using return; sends it back there, but i want it to go back to the start of the main function (basicaly start again). As … |
The End.