Forum: C 2 Hours Ago |
| Replies: 1 Views: 38 That's not help. That would be doing your homework for you.
Read the forum rules.
You need to show effort, and what better way than posting the code that you have tried so far? |
Forum: C 2 Days Ago |
| Replies: 21 Views: 453 I do not know what you mean by "did it require three senior posters calling this person down...", but if you are troubled by the amount of feed back those two "misguided" posts have produced, perhaps... |
Forum: Shell Scripting 8 Days Ago |
| Replies: 1 Views: 233 isxrc> PLS PLS PLS can someone help. I have 24 hours from now and the clock is ticking.
The urgency is on your part, not on ours. You have chosen to fail already.
Read the rules of the forum. We do... |
Forum: C 11 Days Ago |
| Replies: 8 Views: 306 -ansi switch, all that it does is to support the C89 features and disable the GNU extensions that conflict with C89, but it doesn't mean that it will make gcc compiler to behave as a strict ANSI... |
Forum: C 18 Days Ago |
| Replies: 5 Views: 369 scanf("%f", &length);
length is an int, you are passing a float. Same with scanf("%f", &breadth);
Either you change the type in the declaration of length and breadth, or change the f to d in the... |
Forum: C 22 Days Ago |
| Replies: 4 Views: 312 Read the comments I added to your source code.
Of course if you were looking to assign the values of the structure poly p at declaration time, then it would have been:
struct poly p = { 45, { 1,... |
Forum: C 22 Days Ago |
| Replies: 9 Views: 374 If you would take a little time to understand the information I gave you via links, in the second post, you probably would have not need to ask that question. |
Forum: C 23 Days Ago |
| Replies: 9 Views: 374 Or up and down. It doesn't matter. It is undefined behavior.
If a plane doesn't have a pilot, it doesn't matter if people speculate about the capacity of fuel tanks to make the trip, or the... |
Forum: C 23 Days Ago |
| Replies: 9 Views: 374 Click here (http://www.daniweb.com/forums/post1048411.html#post1048411) and here (http://www.daniweb.com/forums/post1049104.html#post1049104). |
Forum: Shell Scripting 23 Days Ago |
| Replies: 14 Views: 897 As you have been shown you can pipe the ls command to another program that further parses the output, in this case awk.
awk can do a lot of things, but even in its simplest form it can be very... |
Forum: C 23 Days Ago |
| Replies: 6 Views: 443 Expressions has direct effects and side effects.
This expression, x = y; has a direct effect of copying the computed value of y assigning it to the location x.
x = a[i]; has a direct effect as... |
Forum: Shell Scripting 23 Days Ago |
| Replies: 14 Views: 897 Look into the command touch |
Forum: C 23 Days Ago |
| Replies: 4 Views: 321 I knew there was more to it than what you stated previously.
What you wanted to know is if a void function can be use as the stop control for a loop. And the answer is ... no. There's nothing for... |
Forum: C 23 Days Ago |
| Replies: 4 Views: 321 Yes, why do you ask? There must be something else you want to know. |
Forum: C 23 Days Ago |
| Replies: 2 Views: 238 Instead of out = fopen (out, "w");
it must be out = fopen ( filename, "w" ); where filename is a string with the path to the file you want to write.
Remember, when you use the "w" if the file... |
Forum: C 23 Days Ago |
| Replies: 6 Views: 443 Those two expressions invoke undefined behavior. Anything can be the result.
It is best if you write int main(), and return inside of main to comply with the standard. |
Forum: Shell Scripting 23 Days Ago |
| Replies: 11 Views: 980 if ( ${cnt} -ge "1" ) That reads if cnt is greater or equal to 1 therefore != would have not worked.
if ($cnt >= 1) then
# whatever you want to mail
endif |
Forum: C 24 Days Ago |
| Replies: 3 Views: 314 There's not such a mechanism of translating C to Java, except for the most rudimentary and simple statements. Since both languages are different, all that it can be done is to understand what the... |
Forum: C 24 Days Ago |
| Replies: 4 Views: 310 Variable str is created when the function leer() is used. It is [1]destroyed when the function leer() is finished. You are returning a pointer to that memory that might or might not contain the... |
Forum: Shell Scripting 24 Days Ago |
| Replies: 11 Views: 980 csh doesn't use if/fi but rather if/endif. Look at posted script and you'll see you have an if/fi.
BTW csh doesn't have the same conditional operators than bash so -ge doesn't work. |
Forum: C 28 Days Ago |
| Replies: 6 Views: 387 Nope. More like:
struct amicable *record;
/* record must point to some memory before using it */
record = &a_struct_amicable_block_of_memory; /* can be done with malloc */ |
Forum: C 28 Days Ago |
| Replies: 10 Views: 378 :) segmentation faults occur when you are trying to access memory that you are not suppose to. e.g.
int *x; /* declares a pointer to int, the variable x is holding a random value which will be used... |
Forum: C 28 Days Ago |
| Replies: 4 Views: 255 When you are the original poster you'd see at the bottom, after the last post, the mark as solved title, in blue. Click on it. |
Forum: Shell Scripting 28 Days Ago |
| Replies: 4 Views: 513 Find any difference between both and then match it. e.g. with HOOK by itself in a line we can match the beginning and end of the line. Thus:
grep '^HOOK$' file_name
Once you have down the... |
Forum: Geeks' Lounge 28 Days Ago |
| Replies: 26 Views: 2,302 You are worthy of more than one. There! |
Forum: Shell Scripting 28 Days Ago |
| Replies: 5 Views: 615 It makes a difference the quotation scheme.
sed "/$npname.*in/d" parts.txt > parts.tmp |
Forum: Shell Scripting 28 Days Ago |
| Replies: 3 Views: 515 What's the trouble?
In its simplest form, create another executable script with three lines of text, where each line is the absolute path to those three scripts. |
Forum: C 28 Days Ago |
| Replies: 10 Views: 378 char *c; is a pointer, again, it doesn't point to any proper memory allocated to it.
while(fgets(c, 600, fin)!=NULL)
Guess what you are trying to do there? Yeap! Trying to write to poor char *c... |
Forum: C 28 Days Ago |
| Replies: 10 Views: 378 For some, memory management in C, is a curse, nevertheless it is one of the strength of the language.
After allocating memory for it, remove any & in front of those pointers to string like... |
Forum: C 28 Days Ago |
| Replies: 10 Views: 378 struct REPLY *reply; is a pointer, anything you try to write to it it will produce a segmentation fault, since there's no memory allocated for it. |
Forum: C 29 Days Ago |
| Replies: 8 Views: 309 shakunni >Anyone know why this is the case?
A function must be called from another function block which could be the main function or one with a lineage to any main function.
Meaning that main()... |
Forum: C 30 Days Ago |
| Replies: 2 Views: 204 To save the transaction you are almost there.
int bal = 0; /* initialize balance to zero */
instead of bal = 0 + credit; replace for bal = bal + credit; or bal += credit; which is a shortcut. |
Forum: C 31 Days Ago |
| Replies: 2 Views: 222 |
Forum: C Nov 3rd, 2009 |
| Replies: 4 Views: 200 It was intended to be a hint, rather that a question to answer. |
Forum: C Nov 3rd, 2009 |
| Replies: 10 Views: 578 if( line == pattern)
That's a no-no, since line and pattern are strings and you can't compare arrays in that way.
Take a look at the string function strcmp() for that.
However, even if that would... |
Forum: C Nov 3rd, 2009 |
| Replies: 4 Views: 200 if (data_size == SIZE_32 ) {
* ( ((int32_t*)(new_node->data)) + index) = (int32_t) index*2 ;
* ( ((int32_t*)(new_node-> data)) + index) = (int32_t) index*3;
}
else {
*... |
Forum: C Nov 3rd, 2009 |
| Replies: 6 Views: 379 The controlling expression of a switch shall have integer type.
An array of chars will not do. |
Forum: C Nov 2nd, 2009 |
| Replies: 4 Views: 294 It doesn't matter, if she follows your advise she will get a square.
Then you'll learn nothing.
Some clue:
One loop inside another one as previously said.
Outer loop is the number of rows.... |
Forum: C Nov 2nd, 2009 |
| Replies: 2 Views: 248 First, you must understand what constitutes a string in C. It is a sequence of chars terminated with a '\0'.
So if I have this:
char fullname[] = "Jiminy Cricket";
and I want to split it into name... |
Forum: C Oct 30th, 2009 |
| Replies: 11 Views: 490 In the C89 standard, an array must be set with a constant. Which would not allowed what you just did.
int cantidad_frases = 0;
printf("Cuantas frases quieres escribir?: ");
scanf("%d",... |