|
|
Up |
|
|
  |
Author: ikcchowdhuryikcchowdhury
Date: Dec 26, 2008 10:39
Hi
I am new to programming and have no experience so can you please
recommend a good book for beginners.
Thanks
IKC_1994
|
| |
|
| |
1 Comment |
|
  |
Author: cerrcerr
Date: Dec 26, 2008 07:17
Hi There,
I'm trying to write some kind of fifo algorithm.
I have a global pointer "char MyQueue[1024];" and try to append a new
string on the beginning by shifting the current content to the right.
I tried doing...
|
| Show full article (1.20Kb) |
|
| |
13 Comments |
|
  |
|
|
  |
|
|
  |
Author: omkar pangarkaromkar pangarkar
Date: Dec 26, 2008 05:59
For a simple code as follows :
typedef enum {
apple,
banana,
grape
} fruit;
typedef unsigned short fruitkind;
when I have this in code :
fruitkind = apple;
and see the value through GDB while debugging, I get fruitkind = 0
(obviously). What if I want to print the symbol "apple" when I ask for
value of fruitkind. Is there some GDB trick/setting, to do so. This
will be very helpful with enums having large number of members. When
you have large number of predefined states, its represented with this
style and stored in shorts. These enum assigned variables (like
fruitkind) are used widely in code, making it difficult to understand
it when walking through a debugger. Is there any other way to achieve
this without using this style, so that its easy for debugging?
|
| Show full article (0.93Kb) |
|
3 Comments |
|
  |
Author: Frithiof JensenFrithiof Jensen
Date: Dec 26, 2008 05:27
> Even if the loan seeker is carrying a bad credit history the loan is
> available.
Will there be TARP funding available to keep the nation looking pretty even
though we have to eat gruel?
|
| |
|
no comments
|
|
  |
Author: MikMik
Date: Dec 26, 2008 03:16
Hi,
I need the functionality of Perl tr (or Unix tr command) in a C
function. I mean replacing each character of a list of characters with
the character in another counterpart list. For example:
char* str = "hello";
printf("original string: '%%s'\n", str);
tr(str, "ho", "jy");
printf("transliterated string: '%%s'\n", str);
Which must end up printing:
original string: 'hello'
transliterated string: 'jelly'
It would be great if it recognizes Perl regexp syntax like [A-Z], \d,
\s and so on, so calls like tr(str, "[eo]","-") make str = "h-ll-".
Does anybody know if there is a public library which implements this
functionality?. I've looked at glib but can't find something similar.
|
| |
|
3 Comments |
|
  |
Author: Andrew McMeikanAndrew McMeikan
Date: Dec 26, 2008 03:10
I wanted to limit how many chars I read in, but the code below instead of stopping at
7 chars will happily read 30 or 40 car lines and spit them out. Not what I expected.
Any pointers?
cya, Andrew...
#include
int main(void){
char line [100];
while (NULL!=fgets(line,8,stdin))
{
printf("%%s",line);
}
return 0;
}
|
| |
|
10 Comments |
|
  |
Author: PeterPeter
Date: Dec 26, 2008 02:24
> Chad wrote:
>>> Peter wrote:
>>>> The way I'm reading the following fragments is, The function call
>>>> load()
>>>> passes a pointer startPtr which I believe is to be the pointer to the
>>>> head
>>>> of the list " Is this correct".
>>>
>>> It actually passes a pointer to startPtr. Care to share with us what
>>> LISTNODEPTR is? I'm guessing it's something like
>>>
>>> typedef struct list_node* LISTNODEPTR;
>>>
>>> Seems to just obfuscate things.
>
> By obfuscation, I mean that the name "LISTNODEPTR" itself is unpleasant
> to read, suggests a macro, and is ultimately pointless since one doesn't ...
|
| Show full article (2.06Kb) |
|
no comments
|
|
  |
|
|
  |
|
|
|
|
|