Forum: C 6 Days Ago |
| Replies: 2 Views: 182 >> How can i declare it in C
Uh... How about in C? |
Forum: C 7 Days Ago |
| Replies: 3 Views: 261 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 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 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 >> 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 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 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 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 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 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 Views: 326 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 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 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 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 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 |
Forum: C Oct 16th, 2009 |
| Replies: 4 Views: 278 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 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 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 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 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 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 Well, what to you have so far? Code wise? |
Forum: C Oct 14th, 2009 |
| Replies: 1 Views: 234 http://www.eternallyconfuzzled.com/arts/jsw_art_rand.aspx |
Forum: C Oct 14th, 2009 |
| Replies: 10 Views: 453 |
Forum: C Aug 12th, 2009 |
| Replies: 9 Views: 345 What do you need help with? Specifically? |
Forum: C Aug 2nd, 2009 |
| Replies: 5 Views: 376 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 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 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 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 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 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 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 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 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 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 Doesn't hang for me. What OS and compiler are you using? |
Forum: C Sep 17th, 2008 |
| Replies: 10 Views: 1,242 >> 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 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 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... |