15,551 Topics
| |
Very early on when attempting to learn programming in C, you often do exercises that read in and print out strings and numbers. Now you might assume that C has a simple function that will get user input, and indeed it does, but there are a couple of gotchas that … | |
please help I want to reading .wav file and putting ito inot the array to do some manipulations.... here is the bit of the code, I am trying to read the file called yes1.wav and putting it into the array and it returining junk...sometime cannot open the fp1 = fopen( … | |
This program was developed and tested in the XP environment, so the requisite platform is Windows. It demonstrates some basic sound file manipulation techniques using the Multimedia Control Interface (MCI). | |
Hi, I need to open a file containing string values one below the other and display them. I'm able to open the file but there is some error while displaying them. Below is my code, kindly guide me to my mistake. [code=c] FILE *fp; char airfoil[6]; fp=fopen("/cygdrive/d/airfoil.txt","r"); if(fp!=NULL) { while … | |
[CODE]#include<stdio.h> void main() { int i=1,j=1,n=9; printf("enter the char"); scanf("%d",&n); while(i<=n) { while(j<=i) { printf("%d/0",i); j++; } printf("/n"); i++; } }[/CODE] OUTPUT 1 22 333 4444 55555 | |
Hi all. I'm trying to develop a Winsock program in C. I can already compile the program correctly but I don't get any output when I run it. I don't know how to exactly use the WSAStringToAddressA function so I think it's the root of my problem. I'm using this … | |
WHEN I TRY TO OPEN FILE IN APPEND MODE ,IT CREATES THE FILE BUT IT SAYS "IN-VALID ENCODING " ALONG WITH THE FILE-NAME ........I HAVE PASSED THE ARRAY OF STRINGS CORRECTLY IN string moreover the strings in "string" are sorted .....any string in "string" is made up of only 4 … | |
Greetings to you friends)) Advice please - how to get integer value from the console? I did so, but nothing good can come out - [CODE] short int n = 0; n = (int)getchar();[/CODE] thank you in advance for your reply )) | |
Hi, I want to create a text file with the name as SYSTEM DATE... for example---28/04/2008:9:11:50.txt The File name should be allocated dynamically. Can you provide the c code for this? Plese help me. | |
Hi All.. I'm writting my own replacements for the memory allocation/deallocation routines malloc() and free().In that file i'm using some variable names.. So after getting the header file, how can i use those previous variable names which i declared in mymalloc programme in any programme. In my main programme i … | |
Hi y'all, I'm new to C and to this community so kindly bear with me. I need to open a txt file using C(only).The thing is I'm able to open it if it is directly inside a drive partition(D:\), but if it is inside a folder then its not opening. … | |
Hi, Can anyone tell me how to concatenate two strings in NetBeans using Cygwin and also what is the right header file to be included? | |
Hi there, I have to make a function valid_dice_selection that helps another function select_dice to check the length of a string and besides that it has to check that the characters in that string only include 'x', 'X' and '-'. Ive gotten so far: Im not sure how to check … | |
Dear respected programmers. Please could you help me (again) on how to put the following code into functions for my program. I have read on-line and understand how functions work but when I do it myself it all goes pear shaped(I am such a noob). Please could you help with … | |
Im new to C, this will probably become apparent. I've been working on this program for about two months now and im getting to the final stages of it being completed. I just need to clean a few things up. Anyways, one of the functions my program does is sends … | |
Hi, It is my very first post, im doing it because i know some C basics and now im stuck with more advanced problems, more catchy questions. Lets say iv allocated a memory block by function called calloc. i have 1 bit field [CODE]struct datatype { unsigned short int a: … | |
Hello there, I'm new to C programming and am following a course in C. I've got an example code for piping. It's not a very hard code to understand. It goes like this: [CODE] #include <stdio.h> #include <unistd.h> #include <stdlib.h> #include <string.h> #define READ_END 0 #define WRITE_END 1 const char … | |
1.What is diffrence Between NULL and '/0' characters? 2.Does the last cell os a string has NULL or '/0'? | |
Hi, Could someone tell me how to open a file in C based on user input. This is what I have tried: [code=c] printf("enter the filename"); scanf("%s",filename); fp1=fopen("filename","r"); [/code] | |
how can I output 123454321, if i input 5. and 1234321 if i input 4? | |
Hi everyone, I need to write a bunch of x,y coordinates to a txt file one below the other using C(only). I'm able to do so but all the coordinate values occur one next to the other. Here's my code: [code] FILE *file1 = fopen ( "/cygdrive/d/newfile1.txt", "w" ); printf("The … | |
can anyone help me with the above problem? i need the code in C language. the problem is: Store random numbers into two-dimensional array of 6 * 6 and interchange first 3 rows with last three rows thanks you in advance. | |
Hi everyone! I have a task that needs to be made in C in Linux. I use Kubuntu. This is the task: Process (coordinator) creates 5 working process (pool of processes). The working processes are waiting to be awakened by the coordinator, perform a job and wait again. The coordinator … | |
Can anyone tell me the Coding for: [ATTACH]18596[/ATTACH] Help me!!! | |
Hi, I have a problem with fread,i wrote that program and in the input file only "Hello Word". the out put of the program only prints "Hell" and when I increase the elements in fread to 2 it outputs "Hello Wo". so for each element in fread it reads 4 … | |
Hi ! I have a C source code of Knight' Tour like [CODE] #include <stdio.h> #include <winbgim.h> #include <stdlib.h> #include <conio.h> #define N 8 void alternatif_bul(int,int); void alt_say_hesapla(); int yeni_konum_bul(); void alt_dizi_sifirla(); int board[N][N]={0}; //satranç tahtası int alt_x[8]={0}; //gidilebilecek alternatif karelerin X konumlarini tutuyor int alt_y[8]={0}; //gidilebilecek alternatif karelerin Y … | |
I need to write a code that receive from the user numbers (must use with EOF) and store them into a matrix. There are some more requirements: 1. Matrix must be only N*N size, while N will be defined at top. 2. If user is trying to enter more than … | |
Hey guys using Linux(C) using POSIX API system calls read,write, open etc. I can open,read,write to a file and copy its contents to an output file. How would I go about copying more than one file to an output file using related system calls only. I currently have: [code=c]filein = … | |
Hi, I'm having a problem with my C code. I have a program that fork()'s a child process. The child process waits a time period defined by command line parameter, then alarms the parent process. Now, the program has to handle SIGUSR1 and SIGUSR2 signals too. The first one should … | |
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 … |
The End.