Search Results

Showing results 1 to 40 of 1000
Search took 0.12 seconds.
Search: Posts Made By: Salem ; Forum: C and child forums
Forum: C Sep 18th, 2009
Replies: 2
Views: 325
Posted By Salem
Standard C doesn't allow you to declare variables in the middle of statement blocks.
Forum: C Sep 18th, 2009
Replies: 3
Views: 639
Posted By Salem
http://www.daniweb.com/forums/thread223648.html
The amount of effort it took just to reverse a string makes this near impossible for you.

You need some more intermediate steps if you actually...
Forum: C Sep 17th, 2009
Replies: 20
Views: 807
Posted By Salem
Post your code!
Did you initialise i ?
Forum: C Sep 17th, 2009
Replies: 20
Views: 807
Posted By Salem
result[numchars++] = basechars[r];

When you're done, print from numchars-1 back down to 0 (one char at a time).
Forum: C Sep 17th, 2009
Replies: 2
Views: 401
Posted By Salem
> typedef struct queue_type *Queue;
This should come AFTER your actual struct declaration.
Forum: C Sep 17th, 2009
Replies: 20
Views: 807
Posted By Salem
> basechars[r]
You're printing them, not storing them!
Forum: C Sep 17th, 2009
Replies: 5
Views: 343
Posted By Salem
Well writing it on Linux using g++ would be a real test of your skill at writing portable software that will compile on ANY compiler.
Forum: C Sep 17th, 2009
Replies: 20
Views: 807
Posted By Salem
Store each char in another array, then print it out backwards?
Forum: C Sep 17th, 2009
Replies: 20
Views: 807
Posted By Salem
Well it's good for bases < 10

char basechars[] = "0123456789";

and
printf("%c", basechars[r] );
Forum: C Sep 17th, 2009
Replies: 8
Views: 252
Posted By Salem
More cross-forum spamming
http://cboard.cprogramming.com/c-programming/119681-help-c-code.html

Ever feel like you're just wasting effort reading and answering the SAME question over and over...
Forum: C Sep 17th, 2009
Replies: 5
Views: 343
Posted By Salem
> I use only linux and I am unable find the compiler.
And what are you going to do with the executable when you've compiled your code?
Forum: C Sep 17th, 2009
Replies: 5
Views: 299
Posted By Salem
char *words[n];
words[0] = wordlist[0];

And so on.
Forum: C Sep 17th, 2009
Replies: 20
Views: 807
Posted By Salem
> That is how I get the binary.
That's how you do it for every other base as well.
Forum: C Sep 17th, 2009
Replies: 2
Views: 483
Posted By Salem
16 replies over here -> http://cboard.cprogramming.com/c-programming/119668-circular-buffer.html

In other news -> http://www.catb.org/~esr/faqs/smart-questions.html#forum

And finally, the...
Forum: C Sep 16th, 2009
Replies: 5
Views: 299
Posted By Salem
Sure, but that would take up more memory.
You would need to store an array of char* somewhere.
Forum: C Sep 16th, 2009
Replies: 4
Views: 248
Posted By Salem
http://cboard.cprogramming.com/c-programming/119649-malloc-why.html
Forum: C Sep 16th, 2009
Replies: 5
Views: 299
Posted By Salem
A pointer to a 2D array is not a **
http://www.daniweb.com/forums/post859293.html#post859293

Use the typedef approach if you want to keep your sanity ;)
Forum: C Sep 16th, 2009
Replies: 7
Views: 319
Posted By Salem
True, removing the redundant #include <iostream> and making sure to invoke the C compiler would be a lot simpler than going the other way.
Forum: C Sep 15th, 2009
Replies: 3
Views: 279
Posted By Salem
> Not sure why you have two while loops?
Just copy/paste - nothing more

And your while loop is far too complex.
Put most of the code into the body of the loop.
Forum: C Sep 15th, 2009
Replies: 16
Views: 681
Posted By Salem
> temp=(char**)malloc(rows);
The red is a cast expression, and is unnecessary.

And it is also HORRIFICALLY wrong on the size as well - damn, didn't spot that one earlier.

It should be
temp=...
Forum: C Sep 15th, 2009
Replies: 3
Views: 279
Posted By Salem
Well you're not using fscanf correctly, so no wonder it blows up.

int val;
while ( while(fscanf(dFile, "%1d", &val ) == 1 )
Forum: C Sep 14th, 2009
Replies: 4
Views: 757
Posted By Salem
Use integers.

Or tell us the problem you're really trying to solve, rather than attempting to fix your solution with one line of code.
Forum: C Sep 14th, 2009
Replies: 5
Views: 694
Posted By Salem
How would I know.
You've now got two programs, and you've posted the code for neither of them.
Forum: C Sep 14th, 2009
Replies: 16
Views: 681
Posted By Salem
> char t=address_array(M,N);
You're returning a char**, so try
char **t=address_array(M,N);

> printf ("%s",t);
Try (with the first fix)
printf ("%s",t[0]);

> for(j=0; j<columns; j++)
OK,...
Forum: C Sep 14th, 2009
Replies: 5
Views: 694
Posted By Salem
if(! CreateProcess("C:\\WINDOWS\\system32\\cmd.exe",
This needs to be something like
if(! CreateProcess("C:\\Users\\me\\Documents\\Projects\\Fib\\myfib.exe",

It does all the work.

This code...
Forum: C Sep 14th, 2009
Replies: 16
Views: 681
Posted By Salem
So replace float** with char** and a different kind of scanf call.
Forum: C Sep 13th, 2009
Replies: 3
Views: 263
Posted By Salem
Forum: C Sep 13th, 2009
Replies: 2
Views: 215
Posted By Salem
Use %s to print a string of chars.
Forum: C Sep 13th, 2009
Replies: 3
Views: 263
Posted By Salem
You mean like a web browser?
Forum: C Sep 13th, 2009
Replies: 3
Views: 283
Posted By Salem
counter += 1*(ch=='(') - 1*(ch==')');

It's cryptic because anything simple is the whole answer on a plate.
Forum: C Sep 13th, 2009
Replies: 3
Views: 283
Posted By Salem
So use a counter.
Forum: C Sep 13th, 2009
Replies: 4
Views: 281
Posted By Salem
fopen() to open a file, fclose() to close it when you're done.
fgets() to read each line from the file
sscanf() to extract information from the line

The first step is to show you can read the...
Forum: C Sep 13th, 2009
Replies: 1
Views: 265
Posted By Salem
Already answered
http://cboard.cprogramming.com/c-programming/119526-help-lru-replacemnet.html
Forum: C Sep 13th, 2009
Replies: 4
Views: 281
Posted By Salem
> How I will load it and then assign it to hash table
So is this about reading files, or hash tables?
Forum: C Sep 13th, 2009
Replies: 3
Views: 330
Posted By Salem
> if(fgets(temp, sizeof(temp), file) != NULL)
To read the whole file, do
while(fgets(temp, sizeof(temp), file) != NULL)

Oh, and remove the fclose() from inside the loop.

Or better yet, leave...
Forum: C Sep 12th, 2009
Replies: 3
Views: 273
Posted By Salem
> i have some work for school that have to finish fast
What else is new (http://www.catb.org/~esr/faqs/smart-questions.html#urgent)

> code that I've found here is written in C++ and i need it in...
Forum: C Sep 12th, 2009
Replies: 1
Views: 397
Posted By Salem
Forum: C Sep 12th, 2009
Replies: 4
Views: 757
Posted By Salem
Like the error message says, you can only do xor on integers.
Forum: C Sep 12th, 2009
Replies: 8
Views: 414
Posted By Salem
> 1) Can you help me how can i achieve this in Visual Studio?
http://www.codeguru.com/forum/showthread.php?t=312742
http://msdn.microsoft.com/en-us/library/e5ewb1h3(VS.80).aspx
Forum: C Sep 12th, 2009
Replies: 12
Views: 977
Posted By Salem
The array sizeof thing only works when the definition of the array is in scope - that is, the compiler can see the actual array.

An array declaration, say
extern int array[ ];

or an array...
Showing results 1 to 40 of 1000

 


About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC