78 Posted Topics

Member Avatar for 3435

[QUOTE=3435;1725525][B]Hello everyone!![/B] I am new to Linux forum and have a question related to typecasting in C related to offset of structures. <snip>[/QUOTE] Typecasting is something that happens to actors...

Member Avatar for Trentacle
0
183
Member Avatar for farhanakram

Have you noticed that n is only ever zero at the beginning of the program? I'm not 100% sure I understand the purpose of it, but I think you should at least reset it on each iteration of the while loop. Furthermore, what happens when tmp ends up pointing to …

Member Avatar for farhanakram
0
6K
Member Avatar for jhellr13

Careful of file extensions, too. Windows will mess you up sometimes... if you save something with the extension, make sure it saves as values.txt and not (say) values.txt.java (this shouldn't happen with any IDE I'm familiar with, but you never did say how you created the file).

Member Avatar for Trentacle
0
157
Member Avatar for shwee

Homework detected, even though you haven't asked a question yet. If this were real code, I'd say go ahead and use goto. The reasons to avoid doing so don't really apply in this particular situation, and it saves time, space and clutter.

Member Avatar for Narue
0
162
Member Avatar for mishabi
Member Avatar for noorf

I don't want to solve your homework problems for you, but maybe I can point you in the right direction. Your problem is that findName finds only the first matching line in the file and returns, correct? So you need to make findName somehow return as many lines as are …

Member Avatar for Trentacle
0
260
Member Avatar for gourav1

"Advanced Java" really doesn't mean anything. I'm guessing it's a class, something like my CS2 class, in which you're still going to be dealing with the ins and outs of the Java language. In other words, probably not looking at hibernate, spring or any of that stuff, and really only …

Member Avatar for Trentacle
0
111
Member Avatar for Natsu

Looks like homework. What are the contents of data_list? What do you need to do to each one?

Member Avatar for TrustyTony
0
169
Member Avatar for skips

I see what your problem is... but the advice I'm going to give is going to be more useful in the long run than telling you straight. [CODE]# after 'use strict' use Data::Dumper; # then in your code, when you want to see the contents of %seqs warn Dumper(\%seqs);[/CODE] Put …

Member Avatar for skips
0
137
Member Avatar for lundon

[QUOTE=Gribouillis;1722771]@valorien: also read this as an alternative to the shebang line: [url]http://www.daniweb.com/software-development/python/code/241988[/url][/QUOTE] This sounds like a bad idea. Non-portable, and it means all your Python scripts have to end in .py (and if by chance you were to have an actual binary end in .py you wouldn't be able to …

Member Avatar for Trentacle
0
162
Member Avatar for winecoding

Use code tags instead of quote tags to preserve formatting. The code you've posted doesn't describe the structure you've said it does. => is just syntactic sugar for a comma, so $chainStorage->{ACB} is [CODE]{ E => '06', [100, 200, 95] => 'B', '23' => [20, 1000, 5, 30], }[/CODE] Assuming …

Member Avatar for d5e5
0
449
Member Avatar for terence193

Can you be a little more explicit about the program requirements? Like, what should the file look like before and after updatefile() is called, in a sample run? The sample code you've written would overwrite anything already in the file, but you called it "update", so... I'm a little puzzled. …

Member Avatar for Trentacle
0
115
Member Avatar for DJSAN10

const-qualified variables aren't the same as constants. [code]int const i = 5;[/code] 5 is a constant. i is a variable that happens to be const-qualified, which means you can't modify it directly. Constants can never be modified, because at runtime they usually don't exist. const-qualified variables, well, it depends. const …

Member Avatar for DJSAN10
0
133
Member Avatar for Paritosh Das

[QUOTE=Paritosh Das;1459746][CODE]#include<conio.h> #include<graphics.h> #include<dos.h> void main() [/CODE][/QUOTE] I'm assuming those three headers provide all the undeclared identifiers in your code. Care to share with us where they come from? main() returns int.

Member Avatar for jonsca
-2
372
Member Avatar for Jcastillo2010

[CODE]printf("Enter the weight in pounds> "); scanf("%lf", &pounds);[/CODE] Two notes here. First, there's no \n, so the implementation isn't obligated to print the prompt before waiting for input; use [icode]fflush(stdout)[/icode] to make sure it works regardless. Second, check the return value of scanf() to make sure your zero is actually …

Member Avatar for Trentacle
0
171
Member Avatar for pinsickle

userRequest is local to getCommand, which means its memory disappears when control returns to main(). strtok() doesn't allocate new memory -- it just zero-terminates a token in the source string and returns a pointer to its first character. Therefore all the addresses in the parameters array are invalid when getCommand …

Member Avatar for pinsickle
0
211
Member Avatar for Madmark88

[QUOTE=Madmark88;1456013] [CODE]#include"stdio.h" #include"conio.h" #include"math.h" int main(void) { int a,b = 0; int c=0; printf("Please enter a number : "); scanf("%d",&b); for(a=0;a<1000;a++) { c=(a*a*a)-(a*a); if(b==c) { printf("%d",a); } } getch(); } [/CODE][/QUOTE] For starters, get rid of that conio.h and getch() nonsense, and use angle brackets to surround standard header files, …

Member Avatar for Trentacle
0
158
Member Avatar for BLUEC0RE

[QUOTE=WaltP;1454293]But [iCODE]ungetc()[/iCODE] is non-standard and therefore not recommended. It will not work in most compilers.[/QUOTE] Standard section 7.19.7.11 (The ungetc function) begs to differ.

Member Avatar for WaltP
0
177
Member Avatar for yen chin

Try [url=http://tinyurl.com/46mattc]here[/url]. I have plenty of projects of my own to do, thanks very much.

Member Avatar for jonsca
0
122
Member Avatar for lochnessmonster

I could tell you how I would do it, but it smells like homework and something you should be working out on your own. If you have specific problems, post [B]complete, compilable code[/B] and ask specific questions.

Member Avatar for WaltP
0
381
Member Avatar for ram619

float prod() is not a prototype, it's merely a declaration. float prod(int, float) is a prototype. As you have it declared, prod() returns int. You'll need to declare it otherwise in order to use it the way you want to. Also, the usual: <conio.h> is obsolete and nonstandard, main returns …

Member Avatar for lisaroy1
0
384
Member Avatar for tiuwulf

[code] mt = (mytype*)calloc(1, sizeof(mytype));[/code] Better is [code] mt = calloc(1, sizeof *mt);[/code] 1) don't cast the result of malloc() (and friends), because all it does is hide a useful warning; and 2) [icode]sizeof *mt[/icode] is shorter than [icode]sizeof(mytype)[/icode], and you don't have to change it if you later change …

Member Avatar for tiuwulf
0
89
Member Avatar for lochnessmonster

There are really two answers to this question: 1) yes and 2) no. Yes, because the cast in this case does no more than make an implicit conversion explicit. It is the same if you do [icode]float x = 12;[/icode] -- you don't need to write [icode]float x = (float)12;[/icode] …

Member Avatar for Trentacle
0
151
Member Avatar for udaykrishnag

[QUOTE=udaykrishnag;1432819]to find the size of image by knowing the height and width....and by knowing the pixel depth...any solutions plz help.....[/QUOTE] What do you mean by "size"? In what units do you intend to measure such a quantity?

Member Avatar for Trentacle
0
40
Member Avatar for trust_noone

"i researched about threading but it's too complicated for me" Translation: "I don't feel like doing real work, can somebody pretty please solve my problem for me?"

Member Avatar for Trentacle
0
90
Member Avatar for hsetaknev

Your first and most obvious error has been mentioned already. Since you haven't said otherwise, I'm assuming you fixed that error, and since you haven't kept complaining, I'm assuming that fixed your problem. If that's the case, could you mark this thread solved? If you're still experiencing difficulties after fixing …

Member Avatar for Trentacle
0
152
Member Avatar for DJSAN10

[QUOTE=DJSAN10;1427307]If the main() takes 3 arguments i.e. int argc,char * argv[],char *env[] and SINCE C DOES NOT SUPPORT FUNCTION OVERLOADING ,y does the c compiler does not give error for simply void main() //that is no arguments at all OR void main(int argc,char *argv[]) //2 arguments[/QUOTE] There are two things …

Member Avatar for DJSAN10
0
192
Member Avatar for onus

I'm not seeing any errors... compiles and runs fine, giving meaningful output. It's rather more verbose and less useful than `ls -F`, though. ;) Do you want to change the way the output is printed? I'd prototype main(), give some thought to the 20-character limit, and use fgets for user …

Member Avatar for Trentacle
0
229
Member Avatar for vedro-compota
Member Avatar for vedro-compota
0
185
Member Avatar for neo2nate

[QUOTE=cool_zephyr;1424587]1. open a pointer to a file 2. read the bytes till the end of file using fread() 3. close the pointer[/QUOTE] I can do you one better: 1. Find a forum that discusses C++. 2. Don't append your question to a 4.5 year old thread. 3. Do some research …

Member Avatar for Trentacle
0
621

The End.