You should replace gets with scanf() or fgets().
Type: Posts; User: Alegomaster
You should replace gets with scanf() or fgets().
Can someone tell me the difference of a Static C library, and a dynamic library, and when to use each one of them.
I really need some help soon if anybody minds.
Nope it doesn't work right now.
EDit did some debugging. Figured out that the array never receives any thing. Just some random junk.
One more issue. It won't display data being received. I am going to debug tomorrow, but I would want early opinions on what to do
#define SerialPort "/test.txt"
#define ConfigFileLocation "/dev/cu.PL2303-00004006"
#include <stdio.h>
#include <stdlib.h>
#include <ctype.h>
#include <unistd.h>
void Send_String(char...
Sorry the Goto calls are just there for know later, I might change it
Working on it now
#define SerialPort "/test.txt"
#define ConfigFileLocation "/dev/cu.PL2303-00004006"
#include <stdio.h>
#include <stdlib.h>
#include <ctype.h>
#include <unistd.h>
// "SerialPort" is location of...
I get the file that is returned from fopen as NULL. I should also mention that I passed the string through a function (that I made) as an argument, and then used fopen from inside that function
For the first argument is it possible to use a predefined string in it.
Okay I am starting to check out stat. Fopen was causing a Segmentation fault on Ubuntu, so thats why I wanted help.
Edit: I can use some help with stat. I'm not that good with structs yet.
Thats okay alot of People make that mistake.
http://cboard.cprogramming.com/c-programming/25765-posting-code-read-first.html
First of all
fprintf is not declared properly. Instead use printf("invalid");.
Judging on your code you should not learn fprintf() yet.
Is there any way to check if a file exists. I usually use a Mac, but for specific reasons I have to use Linux.
First of all read this:
http://cboard.cprogramming.com/c-programming/25765-posting-code-read-first.html
You need to read this about posting code.
What you should do is read about loops....
Okay I have one more issue. The memory will not be freed from the free() command.
int *arrayp;
int *arrayq;
arrayp=Recieve_Data(); // Second Function
Do something with quantum computing. Its a brand new world with that.
And jailbreak it (its legal) so you can run android.
Dynamic Memory does not seem like not working properly.
//main.c
#include <stdio.h>
#include <stdlib.h>
#include "Serialport.h"
First I tried to pass it as an array but it did not work, so I decided for now to call each by itself.
Second I did test, and they work.
Third I will take your other suggestion, and write the code...
Okay I tried to do the mem, and this is the best I got.
I don't get why I have to use Realloc(), or EOF in the file.
//main.c
Okay I tried it but It did not work.
//main.c
#include <stdio.h>
#include <stdlib.h>
#include "Serialport.h"
Thanks trying it now.
Didn't know you had to use dynamic memory.
Can you give me a small example, I don't have a book on C right now. (Got it from the Library)
So I can't see any examples. Thanks for the info right now.