Although you did mention that you were looking for a way to have you function return an array, rather than pass a pointer to an array to the function being called, I thought I'd offer a sample...
Type: Posts; User: sashaKap
Although you did mention that you were looking for a way to have you function return an array, rather than pass a pointer to an array to the function being called, I thought I'd offer a sample...
Hi,
I'm new to C as well. Sorry if my suggestion turns out to be wrong.
As far as I understand, for a function to return an array it should be declared as returning a pointer to a desired type, in...
Thanks a lot!
Thanks for getting back to me. Your input is much appreciated!
Thanks for getting back to me, Adak. Please see the code below. Is this what you had in mind? Thanks.
/* pe6b_new.c -- Write a program that initializes
* a two-dimensional array-of-double and...
Hi,
I've done a programming exercise from a book on C programming (see code below). It compiles and runs. What I wanted to ask about was I get some compiler warnings and I can't figure out why they...
thanks for your input once again!
about having the program end when it reaches a new line...
why is it better? is it because the program assumes that the input will come from the keyboard? i've...
Hi. Thanks for replying to my post about input redirection. i've posted the new version of the program based on the input given by yourself as well as another member. Would you mind having a look at...
thanks a lot to all those who have responded to my query about input redirection. sorry for the delay in replying to your messages.
here's the new version of my program. is this what you had in...
Hi,
Please find below the code for an exercise I had to do as part of a course book I use to learn C.
The program is to accept input from an ASCII text file using redirection, count the number of...
Thanks a lot. I'll have a look at that.
Hi,
I was wondering if there was such a thing as design patterns in C as there is in some object-oriented languages.
If it is available in C, I'd appreciate someone referring me to some web-based...
Thanks a lot. It's clear as day now :-))
No more warnings given by the compiler. Thanks a lot :-))
Quick follow up question about the output of the program, if I may.
Output of printf("\nPointer value: %d, points at value: %d\n\n",...
Here's a simple program that uses a pointer. The program compiles but issues this warning. The compiler I use is gcc.
gcc -g -ansi -pedantic -Wall ex9-2-4.c -o ex9-2-4
ex9-2-4.c: In function...
Understood. Thanks a lot:-))
Thanks for commenting on my post. It looks like scanf() only retains the new-line character if the input being read in is of type char. Is that correct?
Thanks a lot:-))
As far as I can tell it doesn't. Feel free to run it yourself. Let me know if you find it otherwise, if you please. Thanks for getting back to me about my post.
/* ex7-12b.c: Write a program that inputs integers from the keyboard, storing them in an array. Input should stop when a zero is entered or when the end of the array is reached. Then, find and...
No worries at all. Where are you from, if you don't mind me asking?
I am aware that in the English-speaking world Sasha is usually considered to be a girl's name. Where I come from, Sasha is both a man's as well as a woman's name and is short for Alexander. Sorry for...
Thought I'd post the version of the program from the previous post that works. Anyone is welcome to comment on the implementation of the task. Thanks.
/* ex7-12b.c: Write a program that inputs...
Thanks very much to all those who have replied to my post. I'll give all those things a try.
Hi. I am a beginning C programmer. I have a question about arrays. Below is a program I wrote as part of my learning routine. I don't know yet how to get it to exit when zero is entered from the...