Hi , thanks for your reply.
Actually DELIM was defined on top as a " " space.
How do i convert the string to an integer?
Type: Posts; User: hohoholalala
Hi , thanks for your reply.
Actually DELIM was defined on top as a " " space.
How do i convert the string to an integer?
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <ctype.h>
#define DELIM " "
#define BUF_SIZE 100
void *safe_malloc(void *buf,int size);
int
Yep actually i do get a complie error of smth like caldnt compare integer or something of that sort
anyway ill try that thanks
Yep but thats what i need to do, check the first token in each line.
However how do i use a switch to check if that token is equal to a certain character(regardless of if the token is a string or...
sorry i think i got the code tags the wrong way round
#define DELIM " "
int main( int argc , ** argc)
{
char *word;
/* get buffer of the right size */
buf = (char *)safe_malloc((void *)buf,BUF_SIZE+1);
Yes, but what if a string was typed instead of just a character(for debugging purposes) would swithc still work?
Actually i wanna compare the input with a character but i am not sure how to do that since i read in the input line by line.
Thanks
Hey thanks.
But if i am reading it in line - by - line what should i put in my switch statement?
switch(??)
Hey guys :D im new to this forum here.
Anyway i was having a bit of a problem with a program im doing. See, i read data in line-by-line (not files) using fgets, following that i use strtok to...