5,237 Posted Topics

Member Avatar for Pacer

> linklist=(list *)malloc(sizeof(list)); This is a C program, and you're casting the result of malloc. You don't need to do this in C. See [url]http://faq.cprogramming.com/cgi-bin/smartfaq.cgi?answer=1047673478&id=1043284351[/url] > scanf("%d",linklist->data); 1. You forgot the & 2. it's %c for reading chars, %d is for ints > p1=(list *)malloc(sizeof(list)); On the last iteration of …

Member Avatar for Pacer
0
207
Member Avatar for biotech2

> i have tiff, but there is several ways to convert on bmp so any suggestions? code snippets? Yet this seems like such a minor issue compared to the other problem you have of recognising blocks of text, and telling them apart from other marks on the image. I guess …

Member Avatar for Salem
0
137
Member Avatar for soft_pro

> Aug 9th 2004, 12:27 PM You should have waited the full two YEARS before bumping this thread :rolleyes:

Member Avatar for Dave Sinkula
0
214
Member Avatar for yuzhang

You normally have to type in ./program_name Rather than program_name For security reasons, most people avoid having "." on their PATH.

Member Avatar for Salem
0
81
Member Avatar for Asif_NSU

> I know about the issues involving comparison of double datatypes "This is a hole, and I know I'm lying at the bottom of it." What exactly were you expecting to happen? If you know about the issues, why didn't you code around them and test on each compiler? > …

Member Avatar for Asif_NSU
1
1K
Member Avatar for vietbong87

> int integers[0]; Use your constant to set the maximum number of elements in the array > int largest = integers[0]; You can only do this after you've read in some values.... > cin >> integers[i] Your search loop is good. But this too needs to be in a loop …

Member Avatar for nanodano
0
622
Member Avatar for breal

Have you figured out how to sort a 1-D array using your own comparison function, and the standard library qsort() function? It's exactly the same method, the only trick is getting the compare function declared properly.

Member Avatar for dubeyprateek
0
116
Member Avatar for tyczj

> A reference that is not to 'const' cannot be bound to a non-lvalue > insert(subRoot->getLeft(), key.data); At this point, there is no storage location (an l-value) which to take a reference to. All you have is the value (r-value) of the result of subRoot->getLeft() I would suggest you look …

Member Avatar for tyczj
0
125
Member Avatar for johnray31

> here it says there is syntax error Because due to your poor indentation, the return statement is actually outside the function. > tree= (node*)malloc(sizeof(node *)); 1. Don't cast the result of malloc in C 2. you have the wrong sizeof - it's the size of the object, not the …

Member Avatar for johnray31
0
143
Member Avatar for ontrix

You really need to discover the magic of a) indentation b) functions. A 800+ lines of code in main(), c'mon be serious. Nobody is going to wade through that lot just to spot what might be wrong. A rough rule of thumb - if you can't see the entire function …

Member Avatar for Salem
0
108
Member Avatar for jack999

> looking at ur requierment, u can write in swap funtion like What is wrong with using a temporary variable? Not to mention the possibility of data corruption due to whatever way you machine handles arithmetic overflow and underflow.

Member Avatar for Lerner
0
179
Member Avatar for Elleeza

> I want to do the following things in a single program [url]http://www.daniweb.com/techtalkforums/announcement8-2.html[/url] > Help required Did you think of that topic all by yourself? > This very urgent .please help me immediatly. [url]http://www.catb.org/~esr/faqs/smart-questions.html#urgent[/url]

Member Avatar for wwaall2004
0
175
Member Avatar for mohit_mar

> Please help me. It's urgent.... [url]http://www.catb.org/~esr/faqs/smart-questions.html#urgent[/url] [url]http://www.daniweb.com/techtalkforums/thread29300.html[/url] Dredging up long dead threads with pointless "me too" queries won't buy you much sympathy either.

Member Avatar for Salem
0
286
Member Avatar for Tester99

Is this in the compiler itself, or in a program you created which has compiled OK, but which crashes when you run it.

Member Avatar for Salem
0
181
Member Avatar for Cool Nanu

It isn't even valid C, never mind C++. I don't know which crusty old fossil compiler you're using (but I guess it's Turbo C), but you seriously need to upgrade to something in this century. Here are a bunch of edits just to make the thing compile using a C …

Member Avatar for Cool Nanu
0
214
Member Avatar for Te'DDy

Well post your latest effort, and then perhaps we can help you solve the problem. Are you using C-Style char arrays for your strings, or std::string strings from C++ ?

Member Avatar for iamthwee
0
327
Member Avatar for pabarnes

It [b]was[/b] already posted on the C++ forum [url]http://www.daniweb.com/techtalkforums/thread44924.html[/url] Now, it's just a duplicate post.

Member Avatar for tayspen
0
204
Member Avatar for Pacer

What are you after - vacuous post of the week award? How about including some useful information like - which OS - which compiler - which database(s) - which API(s) Not to mention.... - what have you tried already to solve the problem?

Member Avatar for Ancient Dragon
0
188
Member Avatar for schmintan

> then go ahead and do whatever turns you on, but later on you will probably regret it. I agree, it's just another variation on people learning with say TurboC. Learn the language first, then learn an implementation.

Member Avatar for Salem
0
177
Member Avatar for SiliconSpec

Here's a hint: Write a loop which determines the min and max values stored in the array.

Member Avatar for ghadahelal
0
307
Member Avatar for ernie

"but I’m having issues installing." You're expecting to catch the right fish with that bait?

Member Avatar for ernie
0
186
Member Avatar for protmus

> )I'm hoping to learn c++ what's a good book to teach me? First post in the forum is labelled "C++ Books" [url]http://www.daniweb.com/techtalkforums/thread10232.html[/url] > What's good program to use (im looking at making game & programs)? Most people go with dev-c++ [url]http://www.bloodshed.net/dev/devcpp.html[/url]

Member Avatar for Salem
0
82
Member Avatar for tippytoe

> void main(void) [url]http://faq.cprogramming.com/cgi-bin/smartfaq.cgi?answer=1044841143&id=1043284376[/url] > gets(text); [url]http://faq.cprogramming.com/cgi-bin/smartfaq.cgi?answer=1049157810&id=1043284351[/url] Here's a little program to show the same thing using arrays and pointers [code] #include <stdio.h> int main ( ) { char test[] = "this is a test\n"; char *p; int i; for ( i = 0 ; test[i] != '\0'; i++ ) …

Member Avatar for Salem
0
166
Member Avatar for regbrz

So what's the question? How to read the file? One thing to work on is some kind of process table, and 3 functions (doFCFS, doRoundRobin etc) which work on that process table.

Member Avatar for Salem
0
215
Member Avatar for ernie

Introducing the 5-second google search results [url]http://www.horstmann.com/cpp/streams.txt[/url] [url]http://www.boost.org/libs/format/doc/format.html[/url]

Member Avatar for ernie
0
268
Member Avatar for totalnewb++
Member Avatar for qamar2006

> and its due to 15 - 4 - 2006 Seems that's not the only thing which has been missed....

Member Avatar for Dave Sinkula
0
548
Member Avatar for behrk2

It's a pity you didn't format your C code while you were at it :rolleyes: Where's all the indentation to denote block structure, and blank lines to separate one function from another?

Member Avatar for Narue
1
243
Member Avatar for stallion88

> The first three people to complete this program will be entered into the annual contest for Top Coder! Seems the best thing to do is to goto the site and verify this. No wait, this is just another "ruse" to get someone else to do your homework isn't it?

Member Avatar for Rashakil Fol
0
549
Member Avatar for BURNEE

[url]http://www.daniweb.com/techtalkforums/announcement8-3.html[/url] I see no ships!

Member Avatar for Salem
0
208
Member Avatar for jhdobbins

> if (*fp == NULL) You could start here - never mind the rest of it. Say if (fp == NULL) Man, didn't your compiler complain about that line? > while( fgets(questions[x], sizeof(questions), fp) != NULL) If you lie about the buffer size, then it's no better than gets() Besides, …

Member Avatar for Salem
0
3K
Member Avatar for Excal1502

[url]http://www.daniweb.com/techtalkforums/announcement8-3.html[/url] If you really want people to pay attention to your code.

Member Avatar for Salem
0
157
Member Avatar for turkish_girl
Member Avatar for dude543
0
155
Member Avatar for YoTaMiX

Apparently, I wasted my time :mad: [url]http://www.daniweb.com/techtalkforums/thread43435.html[/url] Not only have you dropped the initialisation of univ in main(), but you've gone back to using fscanf to read the file. Not only that, you're now using global variables like "temp", which get allocated on every iteration of the loop and never …

Member Avatar for YoTaMiX
0
229
Member Avatar for antrea
Member Avatar for Salem
0
170
Member Avatar for john_hasan

I think the whole point of this exercise is for you to write a function along the lines of [code]void convertToBase( int number, int base, char *result );[/code] Assuming you know how to do this for base 10, through application of the / and % operators, the rest should follow …

Member Avatar for Salem
0
95
Member Avatar for frenzy44

> version creates 'x' as a const pointer object. When you've finished reading this [url]http://c-faq.com/aryptr/constptr.html[/url] Finish reading this [url]http://c-faq.com/aryptr/index.html[/url]

Member Avatar for Bench
0
198
Member Avatar for amnezia

Perhaps you tried to use ^ as "raise to power" and got some very weird answers. What you need to realise is that you need to call the pow() function in math.h, because ^ is the bitwise-xor operator.

Member Avatar for SpS
0
1K
Member Avatar for neeludhiman

[url]http://unixhelp.ed.ac.uk/CGI/man-cgi?termios[/url] Clear the ECHO bit. You might also consider [url]http://www.hmug.org/man/3/getpass.php[/url] but I think that's a deprecated function.

Member Avatar for Salem
0
91
Member Avatar for poorstudent

> My assignment 's deadlin is by tomorrow. the assignment is avl tree. So you've been sitting on the problem for a week, and now you expect someone to save your ass in 24 hours? > I really need the source codes urgently as without it, the whole program would …

Member Avatar for Salem
0
130
Member Avatar for AhmedHan

> stdafx.obj : error LNK2005: "void __cdecl DebugTest(char *)" (?DebugTest@@YAXPAD@Z) already defined in Internet.obj This is what you normally get when you #include one .cpp file inside another, or put actual code (not declarations) inside header files.

Member Avatar for Salem
0
141
Member Avatar for geez85

1. Please use [code][/code] tags when posting code - see the readme first threads. 2. void main() main returns an int. 3. for(int polygon = 0;polygon < 3;polygon++) This doesn't compile - polygon isn't declared. Try to post what you actually compiled. There's no way for us to guess whether …

Member Avatar for geez85
0
109
Member Avatar for NarenderKumarP

Ah, I see. It's that new style of CSV file without any comma's in it :rolleyes: Perhaps the fields are separated with a tab character instead. > char matrix_points[6][8]; Perhaps std::string matrix_points[6][8]; would be better for storing things.

Member Avatar for NarenderKumarP
0
385
Member Avatar for jlouang

> char month[13] Try [inlinecode]char *month[12]={"January","Febuary","March", "April", "May", "June", "July", "August", "September", "October", "November", "December"};[/inlinecode] > cout << month << " " << day << " " << year << "\n"; You also need to actually call the function as well, say [inlinecode]printMonth( month );[/inlinecode]

Member Avatar for jlouang
0
351
Member Avatar for blademaster

> Been trying ot figure out this for couple days but keep getting syntax errors for some reason. Well post what you tried, then perhaps we can lead you to the answer.

Member Avatar for blademaster
0
63
Member Avatar for YoTaMiX

> void main main returns int > char user_choice; > while (user_choice!='z') This variable is uninitialised at the point you first use it. > university univ; This isn't initialised either. Which is very important when you get to make_file(), since you do - dereference an uninitialised pointer - try and …

Member Avatar for Salem
0
295
Member Avatar for kaun

> properties->settings->advanced->options So I'm guessing you're not using DOS then. So why on earth are you trying to use a DOS compiler then? Do you have a fondness for museums and a longing to be a driver of a steam engine?

Member Avatar for Narue
0
715
Member Avatar for Saint48198
Member Avatar for viet_mafia

Here's a hint [code] g++ -W -Wall -ansi -pedantic -O2 foo.cpp foo.cpp: In function ‘int main()’: foo.cpp:20: warning: ‘ntemp’ is used uninitialized in this function [/code] Fix the order of assignments to actually swap two variables.

Member Avatar for Lerner
0
287
Member Avatar for tuannie

> 1010.1010 Well to the left of the radix point, it's 1, 2, 4, 8 (2^0, 2^1, 2^2, 2^3 etc) To the right, it's 1/2, 1/4, 1/8, 1/16 (2^-1, 2^-2, 2^-3, 2^-4 etc)

Member Avatar for anupam_smart
0
211

The End.