![]() |
Why this program dosent works?
Code:
#include<stdio.h>The main aim of making this program is that :- 1. This program/function will delete all those characters in the first string i.e s[] that matches any character in the second string i.e z[] . And copy the new string of characters to x[]. Problems :- The program is not giving the right output it is printing some garbage value. Questions:- Help me with this piece of code . Tell me where i am wrong and what is the solution. Thank you IN advance. |
Re: Why this program dosent works?
Dude lots of things wrong with that code.I'm posting the updated code this works.I have added comments so you figure it out.
Code:
#include<stdio.h> |
Re: Why this program dosent works?
Code:
#include<stdio.h> |
Re: Why this program dosent works?
elhassane, the button (http://www.go4expert.com/images/buttons/report.gif) is for reporting spam.
|
Re: Why this program dosent works?
Quote:
|
Re: Why this program dosent works?
Quote:
|
Re: Why this program dosent works?
Ok
|
Re: Why this program dosent works?
i think that you must return x[] to then main() function
see my code below. Code:
#include <stdio.h> |
Re: Why this program dosent works?
Another thing lionannesh following things you need to take care
1 Remember = and == are not the same.In your if statement you use = this would assign the variable a value whereas == checks if two values are equal. 2 When setting a flag dummy try to use 1 for on and 0 for off this makes it easier to understand don't use any arbitrary value 3 When passing arrays try to use pointers.It's much more easier |
Re: Why this program dosent works?
Hey shabbir I know this is not relavent to the thread could you take a look at this and help
http://www.go4expert.com/showthread.php?t=21530 |
| All times are GMT +5.5. The time now is 14:29. |