Forum: C Aug 22nd, 2007 |
| Replies: 5 Views: 686 wel this code fit inside a fuction which fill a deck of cards (52 cards)
knowing that ->
static char *s[] = {"Hearts","Diamonds","Clubs","Spades"};
static char *v[] =... |
Forum: C Aug 21st, 2007 |
| Replies: 5 Views: 686 can anyone help me with this code i just cant understand !
its about filling a deck of cards
thx
for (i = 0; i < 52; i++)
{
deck[i] = (i % 13)<<2;
deck[i] += i / 13;
if(i/13 < 2)
... |
Forum: C Apr 11th, 2007 |
| Replies: 13 Views: 6,720 no champ, no there is no text file we just have to test...
./a.out hello world ....
thats all |
Forum: C Apr 11th, 2007 |
| Replies: 13 Views: 6,720 aw zn this test is wrong ?!
c.exe abc def file.txt
argv[1]=abc
argv[2]=def
argv[3]=file.txt
input: abc
buffer = def
input :cajef
buffer= fdjef?! |
Forum: C Apr 11th, 2007 |
| Replies: 13 Views: 6,720 aha but is this the right logic Ancient Dragon ?!
coz looking at his code he seems that he used a totally different logic !
is this the right test for the program ?!
c.exe abc def file.txt... |
Forum: C Apr 10th, 2007 |
| Replies: 3 Views: 1,159 still getting the same thing...
#include <stdio.h>
#include<stdlib.h>
#include <unistd.h>
#include <fcntl.h>
#include <string.h>
main(int ab, char** ar)
{
char buff[800]; |
Forum: C Apr 10th, 2007 |
| Replies: 3 Views: 1,159 hey guyz, i'm trying to search each ar for matching characters in the buff, but I seem to be getting a buffer overflow. Can anyone give me any pointers, any help would be appreciated, this is my... |
Forum: C Apr 10th, 2007 |
| Replies: 6 Views: 1,631 hello guyz, is there any user input i mean like is there fgets ?!
because ./a.out abc def blabla
please enter character : jdk
bef
... ?! is this how it should go ?! |
Forum: C Apr 10th, 2007 |
| Replies: 6 Views: 1,631 alright guyz is that the right logic ?!
replace.exe abc def outputfile.txt
e.g
input output abab dede a ... |
Forum: C Apr 7th, 2007 |
| Replies: 6 Views: 1,631 aha
ok zn i'll start with coding...
thx alote mate |
Forum: C Apr 7th, 2007 |
| Replies: 6 Views: 1,631 umm beauty ! it easy now :) and the ouptputfile.txt should contain only derdfddderd which the last output isn't ?!
1 more question is it right to read from buffer straight away?
for example ... |
Forum: C Apr 7th, 2007 |
| Replies: 6 Views: 1,631 Hey guyz, I'm stuck with this given, its bit hard I cant understand it just wonna know the logic ( no codes).
Its saying write a C program which read from standard input, replaces all the... |
Forum: C Apr 1st, 2007 |
| Replies: 10 Views: 8,995 Thats it zn :)
thanks alote guyz i appreciate it ! |
Forum: C Apr 1st, 2007 |
| Replies: 10 Views: 8,995 umm ehehe :lol: thats pretty easy i couldnt see that :cheesy:
so
delete_stack(POINTER *TOP)
{
POINTER TOP3;
while (Top !=NULL)
{
pop(Top);
*Top = Top3->next; |
Forum: C Apr 1st, 2007 |
| Replies: 10 Views: 8,995 i'm trying to get the delete function but do i have to use loop as wel to delete the stack contents ?!
this is what i got without using the pop function.
delete_stack(POINTER *TOP)
{
POINTER... |
Forum: C Apr 1st, 2007 |
| Replies: 10 Views: 8,995 aw thats beautifull mate !
but why it keeps giving me a Segmentation fault when i try to add the push_string function inside the main ?!
am i using the wrong syntax ?!
for example
int... |
Forum: C Apr 1st, 2007 |
| Replies: 10 Views: 8,995 you mean the same as push but i'll add a for loop for example:
for(i=0;buff[i]!='\0';i++)
{
void push(POINTER *Top, stackitem a)
}
so it keeps taking characters untill eof right ?! |
Forum: C Apr 1st, 2007 |
| Replies: 10 Views: 8,995 Hello guyz i'm trying to write a stack program in C...
Push one character onto the stack. Your function should have the prototype:
void push(POINTER *Top,stackitem a);
2. Push a string of... |
Forum: C Oct 18th, 2006 |
| Replies: 2 Views: 3,064 oups 1 mistake :p
aw ok hehe thats seems easy now :)
anyways found that useful void pointers (http://www.cplusplus.com/doc/tutorial/pointers.html)as well thx alote andor |
Forum: C Oct 18th, 2006 |
| Replies: 2 Views: 3,064 can any one help with this function how it works !
thanks u
int compare(const void *a,const void *b)
{
data i= *(data *)a;
data j= *(data *)b;
if (i.Mark==j.Mark) return 0;
if... |
Forum: C Oct 17th, 2006 |
| Replies: 3 Views: 1,431 is that same as condition ?! like if records[i].m_f == 0 print male else print female ?! |
Forum: C Oct 17th, 2006 |
| Replies: 3 Views: 1,431 hello,
i have a problem with printing records[i].M_F on the screen while reading from a binary file.
i'll appreciate any help !
THank U
#include "stdafx.h"
#include <stdio.h>
#include... |
Forum: C Oct 14th, 2006 |
| Replies: 8 Views: 1,528 Thanks for replying mate ! wel thats true ! i have to use some parameters but thats the problem specifications and i cant change them at all !
they gave us the function parameters for push and pop... |
Forum: C Oct 14th, 2006 |
| Replies: 5 Views: 1,464 think about it like this !
ask the user to enter two numbers the first(m) and the last (n)
second ya gonna count from m to n so from 3 to 6 ! (for loop)
with condition that 3 is included and 6... |
Forum: C Oct 14th, 2006 |
| Replies: 8 Views: 1,528 wel its working fine but the logic of the condition statement in both push and pop probably wrong, i'll appreciate any Help thx ! :)
#include<stdafx.h>
#include<iostream> /* i'm using Iostream... |
Forum: C Oct 13th, 2006 |
| Replies: 8 Views: 1,528 haha trying to figure out
but i have a function related to depth
void set_depth(int size)
i think its the size of the stack |
Forum: C Oct 12th, 2006 |
| Replies: 8 Views: 1,528 What about if i check the number of characters for example
char *stk_layer[100];
int current // buttom of the stack
int depth; // the depth of the stack
if the depth of the stack <... |
Forum: C Oct 12th, 2006 |
| Replies: 8 Views: 1,528 Hello,
how can i check that pushing characters into stack is successful (logically)? |
Forum: C Oct 8th, 2006 |
| Replies: 7 Views: 1,598 we r not gonna do ya home work !
just start thinking about the logic of how the program works and write ya pseudocode and zn write ya code...
and after that we will Help ya !
cheers |
Forum: C Oct 7th, 2006 |
| Replies: 19 Views: 3,892 sorry bout na postin the programs , i'm uni student and for sure i'll get a good circle if somebody copy It.
DANIWEB is wide opened on google and yahoo ! :p so everyone in ma class will have the... |
Forum: C Oct 7th, 2006 |
| Replies: 19 Views: 3,892 wel waltP, i'm doing two programs in the 1st one i have to read from a csv file and eliminate the ","
s1.csv contents:
2,Ajle,1999999,235.6,6
3,ksiSeal,1062230,222.8,2
...
...
...
the second... |
Forum: C Oct 6th, 2006 |
| Replies: 19 Views: 3,892 that works fine mate !
any website about conversions ! i better get some knowledge !
cheers Champ |
Forum: C Oct 6th, 2006 |
| Replies: 19 Views: 3,892 oi its WorkSSS :cheesy:
i have kinda of phobia from conversion ! do u know any good site for conversions !
thx mate :!: |
Forum: C Oct 6th, 2006 |
| Replies: 19 Views: 3,892 Heheh :] wts happening here :)
wel
for each line in the source file
read a line <----------------------------- thats easy !
replace all commas with semicolons <--------- i'll try my... |
Forum: C Oct 5th, 2006 |
| Replies: 19 Views: 3,892 aha !
if i want to write to a file, do i have to fread it first or just
fwrite it straight away ?
thx champ |
Forum: C Oct 5th, 2006 |
| Replies: 19 Views: 3,892 aha beautifull ! now i got it ! :)
1 more question !
strcpy(rcust[i].item, strtok(NULL,","));
i used the strtok to read untill i reach a comma...
how can i replace the comma by a ";" ?
for... |
Forum: C Oct 5th, 2006 |
| Replies: 19 Views: 3,892 Hi,
can any one tell me what size_t_count does, i couldnt get it .
thanks guyz !
fwrite(const void*_str,size_t_Size,size_t_count,file *_File); |
Forum: C Oct 3rd, 2006 |
| Replies: 4 Views: 5,210 aw thats beautifull !!!
cheers mate i'll work on strtok() !!! better know how it works :) |
Forum: C Oct 3rd, 2006 |
| Replies: 4 Views: 5,210 :) heheh
wel it was only a scratch i'm trying to do a totally different program...
and its C.
#include "stdafx.h"
#include <stdio.h>
#include<stdlib.h>
typedef struct sales
{
int... |
Forum: C Oct 3rd, 2006 |
| Replies: 4 Views: 5,210 hi, i didn't get any reply probably coz ya didn't understand what i mean !
alright i'll make it simple.
i have a file in excel and i have to read from this file
here is the contents of this file... |