Hi, its been a long time since I've done any C, and I've forgotten how to use a pointer in a function declaration. For example I want to declare a function with two arguments, an integer, and a...
Type: Posts; User: bertazoid
Hi, its been a long time since I've done any C, and I've forgotten how to use a pointer in a function declaration. For example I want to declare a function with two arguments, an integer, and a...
Thanks for all the replies. Basically at the computer side, I need to sent and recieve data from/to a radio transceiver, with a 4 wire SPI interface. Unfortunately, while RS232 would be easier to...
Hi, I am designing a device which I'd like to control from the USB port. I'll use a simple command prompt program in C. Where do I get started with transmitting and receiving data from/to the USB...
Hi, I've got sky broadband at the moment it my house, and am using the modem/router they supplied us, however it's not very good - the range on it is not very far at all. I was wondering if I could...
Makes sense. Thanks alot.
try:
fgets(word,15,stdin);
the first argument of fgets is the string which you want the read data to be stored, which is "word". If you haven't declared a string "szo" yet in your code I'm...
what does -> mean in a c or c++ program?
Thanks both thats alot clearer now :)
matsp, that's a really good example thanks. Also, I forgot to ask my other question: What's the point of using cin and cout instead of printf etc to output to a terminal or file? There must be some...
Ok thanks, that's easy enough
Hi, I've been programming in c for a while, and have started reading about c++. Having never done any OO programming before, I'm trying to get my head around objects and classes.
I've read that a...
Thanks :)
How do I start writing and compiling programs then? For instance in linux I would use gedit to write a program, and compile it from a terminal.
Hi thanks for all the replies. I'm just wondering can I program things in dos using MinGW and cygwin?
I don't want to be able to make full blown applications with GUI's on windows.
Also, I've...
Yeh but doesn't this allow you to access the parallel port registers?
Also I have some code here for checking the BIOS data area to obtain the memory locations of the different ports connected to...
Hi matsp, then what is the conio.h library all about? I thought this included functions for parallel port I/O. I have seen a couple of examples of c code where conio.h has been included to...
Hi matsp, thanks for the info. Mingw looks ok I'll probably get started with that. for one program I need to use the include files dos.h and conio.h for interfacing with the parallel port. I assume...
Hi, I've just completed a short course on c programming, where we used linux as a platform - editing with gedit, and compiling with gcc from the command line. I wan't to start making some programs on...
Thanks, I was under the impression I could only pass arrays to functions as pointers. Well if not, great, since it's confusing as hell.
As for the first errors, I thought I had already specified...
I tried this:
#include <stdio.h>
int add(int (*a1)[][3], int (*a2)[][3], int (*a3)[][3]){
int i,j;
for(i=0;i<3;i++){
for(j=0;j<3;j++){
a3[i][j]=a1[i][j]+a2[i][j];
I'm trying to write a function that takes two (same-size) 2D arrays of numbers and adds them element wise, returning a third 2D array.
using:
int add(int (*a1)[][],int (*a2)[][])
{...}
...
Hi, how do I declare pointers to 2D arrays, and how can I then pass these as arguments to a function? The syntax must be different to that of 1D arrays, since I keep getting compiler errors when...
Thanks, I'll give it a try.
I thought it was possible, but never actually tried it myself, seems an obvious enough extension of being able to read/write .pgm images though.
OP: If you want to program a GUI in c, then you can...
Hi, I'm trying to learn about function pointers and how to use them.
I have the following partially written program in c for a simple calculator, and without using a switch statement, how can I...
You can 'create' greyscale .pgm images using c, provided you already have a file for the image to be created to, in the same directory as the executable. I think you can do simialr things with...