The value is actually a float...
Thanks guys.
Mick
Type: Posts; User: mickpc
The value is actually a float...
Thanks guys.
Mick
Here is my structure:
struct components
{
char name[20];
float value;
}x[10];
I am having trouble passing an array to a function, here is my code.
void get_fields(char *fld1);
int main(void)
char array[100];
get_fields(array);
int get_circuit(void)
{
char buffer[100] = {0}; /* initialized to zeroes */
int i,a, rc;
float x;
char member0[10] = "test";
FILE *fp = fopen(FILE_NAME_IN,"r");
if (fp ==...
Ok, I edited the original, but I am still getting every second character blank.
Mick
Oh damn, I didn't catch that, thank you.
Mick
Ooooh is it reading the null character after the number?
Mick
1 1
2
3
1
1
1
I am trying to get some basic file i/o working, here is my program.
//***************************************************************************
//get_circuit
//michael c
//written: 7/5/10...
//name: linecount.c
//description: counts the number of lines in a text document
//
#include <stdio.h>
#include <stdlib.h> //need for file operations?
void linecount(int, char**);
...
Ok worked the last one out, now I am trying to convert to a function, what is wrong with this?
//name: linecount.c
//description: counts the number of lines in a text document
//
...
here is what I have so far...
//name: linecount.c
//description: counts the number of lines in a text document
//
#include <stdio.h>
#include <stdlib.h> //need for file...
I am refreshing my C knowledge, I am wondering how I would count the number of lines in a text file?
I have looked up the ascii code for a CR, this being 0x15, is it as simple as scanning the file...
Is that a already made makefile? Or will I have to create it? If not, where would I find it?
Also do I have to enter a value for insert_var_here?
Edit: up until now I have just been typing gcc -o...
I used synaptic to download libsdl1.2-dev and tried to compile a sample file, but the headers were not recognised.
:|
Cheers Mick
I want to do some graphics programming with gcc, and am wondering which is the best graphics libary to use.
Cheers Mick