15,551 Topics

Member Avatar for
Member Avatar for Dave Sinkula

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 …

Member Avatar for WaltP
10
8K
Member Avatar for neo2nate

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( …

Member Avatar for Trentacle
0
620
Member Avatar for banders7

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).

Member Avatar for Azar Mohamed
-3
4K
Member Avatar for phobos666

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 …

Member Avatar for vinitmittal2008
0
212
Member Avatar for hsetaknev

[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

Member Avatar for vinitmittal2008
-1
134
Member Avatar for shinsengumi

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 …

Member Avatar for cool_zephyr
0
197
Member Avatar for omkar1987

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 …

Member Avatar for Narue
0
171
Member Avatar for vedro-compota

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 ))

Member Avatar for vedro-compota
0
243
Member Avatar for malli123

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.

Member Avatar for malli123
0
144
Member Avatar for aplh_ucsc

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 …

Member Avatar for aplh_ucsc
0
110
Member Avatar for phobos666

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. …

Member Avatar for phobos666
0
299
Member Avatar for phobos666

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?

Member Avatar for phobos666
0
101
Member Avatar for arnas

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 …

Member Avatar for WaltP
0
202
Member Avatar for Don_k

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 …

Member Avatar for nezachem
0
146
Member Avatar for Nik.k

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 …

Member Avatar for Nik.k
0
91
Member Avatar for m1n1m3

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: …

Member Avatar for Narue
0
160
Member Avatar for JDevelop

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 …

Member Avatar for JDevelop
0
165
Member Avatar for hsetaknev

1.What is diffrence Between NULL and '/0' characters? 2.Does the last cell os a string has NULL or '/0'?

Member Avatar for hsetaknev
0
150
Member Avatar for phobos666

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]

Member Avatar for Narue
0
32K
Member Avatar for needhelpe
Member Avatar for phobos666

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 …

Member Avatar for saad749
0
150
Member Avatar for bill13

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.

Member Avatar for Mohtadeen
0
273
Member Avatar for didi00

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 …

Member Avatar for didi00
0
145
Member Avatar for kitsan
Member Avatar for Narue
0
135
Member Avatar for Ahmed Sarwat

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 …

Member Avatar for Ahmed Sarwat
0
110
Member Avatar for mg120

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 …

Member Avatar for msaqib
0
223
Member Avatar for Adami

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 …

Member Avatar for Adami
0
137
Member Avatar for Don_k

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 = …

Member Avatar for Don_k
0
219
Member Avatar for bleedi

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 …

0
146
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
167

The End.