Search Results

Showing results 1 to 40 of 73
Search took 0.02 seconds.
Search: Posts Made By: twomers ; Forum: C and child forums
Forum: C 6 Days Ago
Replies: 2
Views: 182
Posted By twomers
>> How can i declare it in C
Uh... How about in C?
Forum: C 7 Days Ago
Replies: 3
Views: 261
Posted By twomers
Why must the function calls be void-ed?
Aside from global variables ... there isn't a direct way of doing it really.
Forum: C 7 Days Ago
Replies: 4
Views: 228
Posted By twomers
It depends on what system you're on. If you're on windows you can use GetFileAttributes (google it) and & it with FILE_ATTRIBUTE_DIRECTORY.
Forum: C 10 Days Ago
Replies: 14
Views: 468
Posted By twomers
It may be easier to parse by reading a line and using sscanf on the line you've read. http://www.cplusplus.com/reference/clibrary/cstdio/sscanf/ Look at the example.

Dave. Why you gotta hate?
Forum: C 14 Days Ago
Replies: 14
Views: 752
Posted By twomers
>> I believe no questions are stupid.
That's naive. And I didn't say the questions was stupid. I said the thread was stupid.

How many times does the same thing have to be said before it's...
Forum: C 18 Days Ago
Replies: 2
Views: 311
Posted By twomers
Well. If it's the digits you're interested in you need only do:lint main( int argc, char *argv[] ) {
long num = 123;
int dig1 = num % 10;
int dig2 = (num/10) % 10;
int dig3 = (num/100) %...
Forum: C 19 Days Ago
Replies: 5
Views: 254
Posted By twomers
You misunderstand. It's -- static ExternalInputs_test2_2 test2_2_U; For non-pointers you use the . operator. Not ->. Try replacing -> with .
Forum: C 20 Days Ago
Replies: 14
Views: 752
Posted By twomers
This thread is stupid.
ahamed101 -- save the data in files and fopen them according to the input parameters of the program.
OR do what you were doing with the #include and just live with code...
Forum: C 21 Days Ago
Replies: 14
Views: 752
Posted By twomers
Actually.
The #include thing only works on compile time. Not run time. So you can't strcat the value of the #include.
Also, your first example mightn't work the way you think.
Forum: C 24 Days Ago
Replies: 5
Views: 327
Posted By twomers
You have two options, really. You can either pass in a pointer to char the pointer that you're passing in, or you can return the allocated array, or indeed both, if you really wanted. So...
//......
Forum: C Oct 31st, 2009
Replies: 3
Solved: UART problem!
Views: 326
Posted By twomers
Does the second program have to do the same thing as the first but must be written differently?
You could always do a switch on readValue instead of the if tree.
Forum: C Oct 29th, 2009
Replies: 3
Views: 231
Posted By twomers
I just code-tagged your code. Please try to do it in future.
Lemms see now...
Forum: C Oct 29th, 2009
Replies: 1
Views: 158
Posted By twomers
Colour text: http://faq.cprogramming.com/cgi-bin/smartfaq.cgi?answer=1048382857&id=1043284392
Picture (though this mightn't work):...
Forum: C Oct 29th, 2009
Replies: 6
Views: 333
Posted By twomers
I'm no assembly guru, but you might be able to find something were you to decompile it.
Forum: C Oct 28th, 2009
Replies: 3
Views: 231
Posted By twomers
Show us some code I suppose.
You should know how deep each element is, and you can use the debth to see how many spaces are needed
I think it'd make sense to print the data to a string, I'd say.
Forum: C Oct 26th, 2009
Replies: 2
Views: 204
Posted By twomers
It works for me...
Forum: C Oct 16th, 2009
Replies: 4
Views: 278
Posted By twomers
Most things can be divided. Do you mean is divided with no remainder?
The modulus operator is your friend here.
for ( i=0; i<10; i++ ) {
printf( "%d mod 4 = ", i, i%4 );
}It returns 0 if no...
Forum: C Oct 16th, 2009
Replies: 6
Views: 361
Posted By twomers
I doubt you'll get any code for free here. So here's an outline of how you might go about it.
Grab the input from the user and compare strcmp() it against references, i.e. "January", etc (might...
Forum: C Oct 14th, 2009
Replies: 10
Views: 453
Posted By twomers
Does that work?
I think the limits of the loops need work, and that you need to consider the input=1 case, but it looks fine. ANd yer missing a ; in places. And you don't need the else. And you...
Forum: C Oct 14th, 2009
Replies: 10
Views: 453
Posted By twomers
Sorta. But you don't want to nest the loops. printf() after each for loop.
for ( counting up )
printf();

for ( counting down )
printf()
The second loop will be going from the upper limit to...
Forum: C Oct 14th, 2009
Replies: 10
Views: 453
Posted By twomers
Ok. Consider using two for loops. One to count up to a number and one to count down. Print the looping variable.
Forum: C Oct 14th, 2009
Replies: 4
Views: 369
Posted By twomers
That's curious.
Try doing \r\n instead. Not sure if that'll help, to be honest, but worth a try.
Can you get a hex editor and look at the hex of the file and see if the \n character is there? It...
Forum: C Oct 14th, 2009
Replies: 10
Views: 453
Posted By twomers
Well, what to you have so far? Code wise?
Forum: C Oct 14th, 2009
Replies: 1
Views: 234
Posted By twomers
http://www.eternallyconfuzzled.com/arts/jsw_art_rand.aspx
Forum: C Oct 14th, 2009
Replies: 10
Views: 453
Posted By twomers
ANd the problem is?
Forum: C Aug 12th, 2009
Replies: 9
Views: 345
Posted By twomers
What do you need help with? Specifically?
Forum: C Aug 2nd, 2009
Replies: 5
Views: 376
Posted By twomers
I was thinking that too, but figured he wanted to ... transpose it for his own reasons.
Forum: C Aug 2nd, 2009
Replies: 5
Views: 376
Posted By twomers
First consider not globalising all the variables and consider passing them by pointer or something from main().

Second, the line should be stringarray[j][0] = string[j]; That should be it,...
Forum: C Jun 20th, 2009
Replies: 4
Views: 386
Posted By twomers
Should try the typical FAQs.
http://faq.cprogramming.com/cgi-bin/smartfaq.cgi?answer=1044844545&id=1043284392
You don't need conio for gotoxy, if it's the gotoxy I was thinking of.
Forum: C May 14th, 2009
Replies: 8
Views: 744
Posted By twomers
MessageBox(0,"Message body", "Message title", MB_OK ); might be what you're looking for. #include <windows.h> to use it.
Forum: C May 14th, 2009
Replies: 11
Views: 1,327
Posted By twomers
Read here http://www.adrianxw.dk/SoftwareSite/FindFirstFile/FindFirstFile1.html (and part 2 and 3), and in the retrieving loop you could simply have a counter that's returned by the function.
Forum: C May 9th, 2009
Replies: 3
Views: 319
Posted By twomers
No. You'll have to write a cyclic shift macros or function. ie, something like
#define cyclicShiftRight(val,shiftBy) ...code here...
[code]#define cyclicShiftLeft(val,shiftBy) ...code here......
Forum: C May 3rd, 2009
Replies: 3
Views: 348
Posted By twomers
At a guess I'd say that fileHandle = fopen(Name,"w"); should be changed to "a" or something. If the function's being called more than once you'll want to append data to the file rather than write to...
Forum: C May 1st, 2009
Replies: 8
Views: 630
Posted By twomers
I'd've thought if you were comparing binary data the memcmp function would have taken const void*'s rather than any kind of char* abstraction.
Forum: C Nov 23rd, 2008
Replies: 1
Views: 910
Posted By twomers
libcurl (http://curl.haxx.se). It's fairly straightforward after you get used to it.

Edit: Once you get the library working this (http://curl.haxx.se/lxr/source/docs/examples/sepheaders.c) should...
Forum: C Oct 17th, 2008
Replies: 2
Views: 458
Posted By twomers
printf()....

Oh and include stdio.h instead of iostream. And time.h instead of ctime.

Also, C doesn't have references, so you'll have to convert those reference parameters to pointers.
Just...
Forum: C Sep 26th, 2008
Replies: 1
Views: 786
Posted By twomers
Doesn't hang for me. What OS and compiler are you using?
Forum: C Sep 17th, 2008
Replies: 10
Views: 1,242
Posted By twomers
>> I have a fixed packet length
I thought the length was a parameter of the packet... guess not anymore.

>> But you could use malloc() to dynamically create an array of any size right ?
Course....
Forum: C Sep 15th, 2008
Replies: 10
Views: 1,242
Posted By twomers
Yeah. Linked list might be of use. So you can continuously grab packets without worrying too much about where they go. Have you the dynamic size thing working? That the length parameter determines...
Forum: C Sep 14th, 2008
Replies: 10
Views: 1,242
Posted By twomers
The first thing you should read about is dynamic memory allocation in C. malloc is the function you're gonna be looking for (and free afterwards). When you understand this write a simple program that...
Showing results 1 to 40 of 73

 


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

©2003 - 2009 DaniWeb® LLC