15,539 Topics

Member Avatar for
Member Avatar for jeeter19

Hi, I'd like to copy one directory to another, including subdirectories. Each file that is copied over needs to have its own thread and each following thread must wait for the previous one to finish and exit before being created. The directory names are passed in *arg separated by a …

Member Avatar for abhimanipal
0
107
Member Avatar for notuserfriendly

I am coding 2 dynamic arrays. basically ive done the first part which requires the user to enter rows and columns, i also implemented the functions to print and fill the created arrays. now the next task is to create a SINGLE dimensional array with enough size to fit the …

Member Avatar for notuserfriendly
0
374
Member Avatar for rickymak

Why is it that in this statement "c = '\t'" is not "c == '\t'" (an additional equal sign). I read an explanation that it is because \t is a visual representation of the tab character. Isn't \n and ' ' also visual representations of a newline and space character …

Member Avatar for mvmalderen
0
110
Member Avatar for centrinostyle
Member Avatar for rickymak

int c; c = getchar(); while ((c = getchar()) != EOF) putchar(c); c = getchar(); I know EOF means end of file. Basically, I believe this functions is instructed to keep inputing text from the keyboard until EOF becomes the subsequent input. However, I am not sure what EOF is …

Member Avatar for Aia
0
190
Member Avatar for rickymak

This program here is supposed to count the number of occurrences blanks, tabs and newlines within the respective text you type within the program. However, after I compile the program and run it on ubuntu's terminal, all I am able to do is punch in text, space, enter etc... endlessly …

Member Avatar for mvmalderen
0
218
Member Avatar for rickymak

Quick question: what does "if(c == '\n') mean in this context? Is it just using '\n' as a reference for a numeric value within ASCII? which in that case would be 10, so if 10 is entered, this is when nl increments up one? { int c, nl; nl = …

Member Avatar for rickymak
0
292
Member Avatar for camdaddy09

As you'll notice this is an assignment from my computer science class, and if you look closely you'll also notice that this was due on march 3, so im not trying to get help for it. All this is for is to create some friendly competition and maybe keep the …

Member Avatar for BestJewSinceJC
-2
147
Member Avatar for mr.confused!

i'm having trouble creating a craps game for school, i'm a light weight c user and any help would be amazing!!!

Member Avatar for UncleLeroy
0
112
Member Avatar for friendfx

Hi there, recently I wrote a small C program utilising the Windows API to communicate with a device over the serial port (COM1, a real serial port of my PC). This worked fine, but I am aware of the fact that those real COM ports are replaced more and more …

Member Avatar for Jason Guo
0
2K
Member Avatar for ajithasati

Hi there, On executing the above code I'm getting the error "segmentation fault". Is it possible to manipulate a string variable which already contains a data?[code]#include<stdio.h> int main() { char *str="Hello"; char * str1 ="World"; strcpy(str,str1); printf("%s",str); }[/code]

Member Avatar for abhimanipal
0
66
Member Avatar for leway

I can't seem to figure out the code you are missing. Any help getting the below code working would be great. [code]#include <stdio.h> #include <stdlib.h> #define SIZE 2 // initially to test kept it to SIZE 2 typedef struct { char firstName[30]; char lastName[30]; char street[35]; char city[20]; char state[3]; …

Member Avatar for abhimanipal
-1
131
Member Avatar for hassall

Have been programming in Turbo C for some time using an XP platform. I have recently bought a new computer also with XP and Turbo C programmes will not run on it. Has XP been modified recently? Is there any solution other than going back to 98? Thanks Cliff

Member Avatar for hassall
0
207
Member Avatar for Dave Sinkula

Never use the function [inlinecode]gets[/inlinecode]. Why? It is unsafe. Since the maximum string size cannot be specified, it is always susceptible to buffer overflow. This snippet shows one way to do a safe version of [inlinecode]gets[/inlinecode]. It reads characters from the [inlinecode]stdin[/inlinecode] into a string up to the specified size …

Member Avatar for Narue
0
2K
Member Avatar for OzY360

Hi i am doing C programming in netbeans and when i compile and run my program i get a message in the dos console that says i need to use the nodosfilewarning to disable the cygwin warning i am getting. I have attached a screenshot as it is a rather …

Member Avatar for baxilo
0
2K
Member Avatar for camdaddy09

ive seen this in code on different forums but i have no idea what it does, could someone explain this?

Member Avatar for omol
-4
107
Member Avatar for krap_nek

hi guys, I'm trying to implement a basic program which deals with structures and pointers. I have to insert data for various citizens, which is structure that have other structures as fields. in this case my main objective is to create 2 general functions that will get the information for …

Member Avatar for UncleLeroy
0
166
Member Avatar for nshh

Hi, please answer me the following questions. It will be very useful for me...Thanks in advance. c questions: 1. storage classes (auto, register, extern, static) in c with these informations (scope, lifetime, default value and memory location(where it stored in memory)). 2. why should we use static in function prototype …

Member Avatar for UncleLeroy
0
131
Member Avatar for lionaneesh

Sir/Maam, please suggest me some very simple tutorials explaning right from the basics of such functions . I am doing C since 6 months and was looking at a tutorial of BEEJ's guide to network programming.. there at looking at a source code i found these functions and am really …

Member Avatar for UncleLeroy
0
108
Member Avatar for rai32

Hello people, i am really sorry to post two new threads in such a short time, but i have a problem that's driving me nuts. I think i know where my program fails, but i don't know the reason why. Let me explain: I am making a chat program. I …

Member Avatar for rai32
0
144
Member Avatar for habib_parisa

Dear All, I am trying to use free function in C to free memory of an array of pointers. It does not work and I get segmentation fault. The code looks like this: [CODE] #include <stdio.h> #include <stdlib.h> int main() { int *make_pointer(int); void read_array(int *array[3]); /****************/ int *array[3] ; …

Member Avatar for jephthah
0
6K
Member Avatar for Eternal49

Ok, I dont really know how to explain what im trying to do. So it might be easier to just look at my code. But basically im getting the following error messages when I try to compile the code, I know what error messages mean, I just dont know how …

Member Avatar for abhimanipal
0
192
Member Avatar for SpyrosMet

hello forum I need help in making a function that randomly chooses between two numbers that I give through the parameters. Please give me a hint or something. Thanks in advance guys.

Member Avatar for Narue
0
506
Member Avatar for Carter12

Hello, I need some advice from some of the more expert programmers on what path should I take further in my learning process. I started with PHP and now I can say I do ok, not an expert of course. I like programming very much and I love PHP, it's …

Member Avatar for omol
0
244
Member Avatar for Xufyan

find the max value in an array ? can anyone tell me whats wrong with this program ? i've just learned what are arrays so don't know much about it, i want to write a program that prints the max value inside an array. i wrote this: [CODE]int main(void) { …

Member Avatar for MageBane
0
244
Member Avatar for ams_chelseafc

I have written the following Code which will convert an integer number to a roman..I have a array list of integer number which I pass through a for loop and the return value is individual converted Roman character.. My Issue is when the converted value is returned from the function …

Member Avatar for jephthah
0
808
Member Avatar for ContactaCall

Hello. I'm currently developing an IVR system under Asterisk through the Asterisk Gateway Interface (AGI), connecting to a Mysql server using the Mysql C API. The server returns a ticket number that I have to say to the client, so I developed a TTS (Text To Speech) algorithm to say …

Member Avatar for saurabhjasuja
1
339
Member Avatar for noobuser

Hi, can anyone help me with this program. the program inputs a string and replace the first char with the second one. [CODE]#include <stdio.h> #include <string.h> #include <stdlib.h> #define MAX 200 int main(void) { char myString[MAX]; char getCh; char setCh; int i = 0; printf("Please enter the string: "); gets(myString); …

Member Avatar for noobuser
0
174
Member Avatar for speedy94519

Hey guys im having trouble writing this code for my function. I have the idea down and a way to solve the problem but im having trouble writing it in C code. Basically im writing a function that runs exactly like the function strcat from the string.h library but we …

Member Avatar for anonymous alias
0
359
Member Avatar for sourabhtripathi

[CODE]#include<stdio.h> #include<conio.h> int main() { int dec,rem,ans=0; printf("Enter the Decimal number\n"); scanf("%d",&dec); while(dec>=2) { rem=dec%2; dec=dec/2; if(rem==0) ans=ans*10; else ans=(ans*10)+1; } printf(" binary number is"); while(ans>0) { rem=ans%10; ans=ans/10; printf("%d",rem); } getch(); return 0; } [/CODE] this code is not working properly for example for 10 it gives 01, should …

Member Avatar for abhimanipal
0
156

The End.