Sir, can you explain why we should/ should not use all those? I'm curious on why I should never use void main and gets?
Type: Posts; User: mugiwara528
Sir, can you explain why we should/ should not use all those? I'm curious on why I should never use void main and gets?
So this is basically my whole program, without the main..
Its an infix to postfix converter and evaluator..
The first time i did this was successful, but it only accepted 1 digit..for example 2*2...
Hello, sorry if I'm asking a lot of questions, but is there any way to convert a char to char*?
I'm reading a string one by one, and if i find a certain character i want to push it to a stack,...
Thank you, i think i get it now. I'll try to see if this goes well with my whole program.
struct node //STACK
{
char *x;
struct node* next;
};
struct nd //QUEUE
{
char *x;
struct nd* next;
I'll be using this for small numbers, so i guess temp[5] will be large enough. Can you explain what happens in your code?
Hello, i really need help. I want to append a single char into a char* that i have..how do i do that? Is it even possible?
char temp[5] ="";
while(isalnum(*x))
{
strcat(temp,*x);
x++;
10947
10946
10948
10949
This is my whole program so far..i undid the changes i made..so its functioning again now but only reads single characters..
If i had
char a[6] = { '1','2','+','3','+','4'};, how do i turn '1' and '2' into just "12" then push it to the stack? I tried using strcat() and made changes to my code, it didnt have any errors at...
Sir, can i ask how to use strtof and how to apply it in my code?
Hey guys, i have a project to convert an Infix Expression to Postfix Expression or the Reverse Polish Notation.
I'm almost done but my code only reads single digits..
For example, if i input...
Oh! I just realized that now. So i have make my char x; to char x[5]; ?? Man i hope this doesnt mess up my program -_-
Forgive me but I cant quite understand the function you gave me XD What does static mean? What does the * before the function name mean too?
Oh really? Thanks, i'll try that.
It's like this
struct node
{
char x;
struct node* next;
};
What i did was convert char to int using atoi, which was successful.
Actually i need to push the converted value to a stack i created, so is it possible to do that using sprintf? I dont want it to print anything
Hey guys, I need help converting an int to char??
I have tried using
char dig = (char)(((int)'0')+result);
which works well, however, it can only convert values from 0-9 if i'm correct.
...
Damn, so that's what's making it wrong. I changed it to
temp=(link1*)malloc(sizeof(*temp));
since my compiler needs an explicit cast...Is that right? It works now...
Thank yoooouuu :D
Here is my function for building the list...
void insert(link *head, int input)
{
link temp;
link curr;
link p;
Hi, its me again. I revised my code and tried to follow what you guys said already, but I'm still getting the stupid window popping out when I try to delete a node from a linked list. (i attached a...
This function is to remove a node from the list and free the memory allocated to that certain node, so i guess i need to use free(), am i right? What do I do?? Do i pass call malloc in my main and...
It worked! I'm not sure though if what I did was right...is it???
link1 *dealloc;
dealloc=(link1 *)malloc(sizeof(link1));
Actually there is, when I try to delete a window pops up and says something like
" Debug Error!
Program: blablabla
DAMAGE: after Normal block (#63) at 0x00431D20
"
Then i have to choose...
Actually i used
typedef struct node link1;
typedef link1 *link;
So I need to put something like dealloc = (link) malloc(sizeof(link)); in my function?