5,237 Posted Topics

Member Avatar for jan1024188

> Whats better? C++ or VB? What's better to a carpenter - a hammer or a screwdriver? Like the proverb goes, "If the only tool in the toolbox is a hammer, pretty soon all the problems look like nails".

Member Avatar for Ravalon
0
331
Member Avatar for Nsin

What do you mean "exists"? It exists by you using it. Like [INLINECODE]printf( "The version is %s", GPSINIT );[/INLINECODE] or [INLINECODE]const char *ver = GPSINIT;[/INLINECODE] or [INLINECODE]char temp[100]; strcpy( temp, GPSINIT );[/INLINECODE] All of them in their own way get the address of the start of that string. Now as …

Member Avatar for Salem
0
119
Member Avatar for darkeinjel04
Member Avatar for Nick Evan
0
109
Member Avatar for degamer106

It outputs a list of all the blocks to the debug console, like {42} block .... You take the 42 and assign it to something like _dbgBreakAlloc (read the manual to find out what it is actually called), then the allocator will stop when that block is allocated. You then …

Member Avatar for Salem
0
200
Member Avatar for amirwan

I dunno, depends on what you mean by "not working". Does it mean "file not found" Does it mean "the file seems to be corrupt". Also, how did you 'include' it? Did you do something like #include "file.lib" // this is wrong Or something else? Where did you get the …

Member Avatar for amirwan
0
285
Member Avatar for shahrossi

You're going to have to do better than just attaching your homework. [url]http://www.daniweb.com/techtalkforums/announcement8-2.html[/url] Also, tell your tutor that void main is wrong. [url]http://faq.cprogramming.com/cgi-bin/smartfaq.cgi?answer=1044841143&id=1043284376[/url]

Member Avatar for Salem
0
27
Member Avatar for apurv

Cryptography is based on algorithms (and some very heavy mathematical analysis), not choices of implementation language. [url]http://en.wikipedia.org/wiki/Cryptography[/url] > I mean that can be acctualised using a C program. Since C is a Turing complete language, if you have an algorithm, then you can express that algorithm in C. > I …

Member Avatar for sham51
0
148
Member Avatar for tehloki

> int ht, wd; You use these in your array subscript calculation, but you never set them. They should be passed as a parameter to the function anyway. > stringPtr[position] = malloc(strlen(setstring) * sizeof(char)); When allocating a string, you need to count the \0 as well, otherwise it ends up …

Member Avatar for Ancient Dragon
0
976
Member Avatar for flageolet

> #include <stdio.h> > using namespace std; So which is it - C or C++ ? Pick a language and stick with it. If you try and walk down the middle of the road with C/C++, you'll just end up being road kill. > struct ALLE_PATIENTENDATA patient[aantal_patienten]; Variable length array …

Member Avatar for Salem
0
154
Member Avatar for jd_1604

From your other [URL="http://www.daniweb.com/techtalkforums/thread68395.html"]post[/URL] > Assert failed at line 250 of c:\code\allegro\include\allegro\inline/draw.inl Open draw.inl in your editor. Goto line 250. Read the line which will be something like say ASSERT(x >= 0); The code expects that expression to be true. In your program, that expression was false. Now ask yourself …

Member Avatar for Salem
0
97
Member Avatar for lotsofsloths

First step is to download a compiler, which matches your operating system [url]http://www.daniweb.com/techtalkforums/thread50370.html[/url]

Member Avatar for lotsofsloths
0
172
Member Avatar for uu666

> somehow to stop that loop ONLY when I press a key You need to say which OS and compiler you're using. There is no portable answer to this question, so we need specifics.

Member Avatar for Salem
0
140
Member Avatar for caltiger

> Is there any way to detect this without using winAPI or any other standard APIs??? No there isn't. Standard C doesn't know about keyboards, mice, screens or other advanced stuff like that. It has an input stream, which is usually buffered, so there goes the "immediate" requirement. It also …

Member Avatar for apurv
0
660
Member Avatar for jd_1604

> myImage = ( "G:\\My Images\\box.bmp", NULL); Were you expecting (or hoping) to call a function at this point? Because all you've written here is myImage = NULL;

Member Avatar for Salem
0
132
Member Avatar for JoBe

[url]http://c-faq.com/ansi/undef.html[/url] To answer the first question with the second question, an example of implementation defined behaviour is >> on negative numbers.

Member Avatar for Ravalon
0
193
Member Avatar for dinochom

[URL="http://msdn.microsoft.com/library/default.asp?url=/library/en-us/multimed/htm/_win32_the_playsound_function.asp"]http://msdn.microsoft.com/library/default.asp?url=/library/en-us/multimed/htm/_win32_the_playsound_function.asp[/URL]

Member Avatar for Salem
0
87
Member Avatar for frank12

> cin >> iNumGrade; So perhaps [INLINECODE]cin >> iNumGrade >> iAnotherGrade; int iTotal = iNumGrade + iAnotherGrade;[/INLINECODE] Or do you want to specifically extract the '+' as well?

Member Avatar for rinoa04
0
87
Member Avatar for VIDHYAPREM

Also, which compiler are you talking about? Also, is this a new problem (like it used to work), or have you just installed it.

Member Avatar for ~s.o.s~
0
94
Member Avatar for Iqbal_h_a

I'd say that you're over interpreting the data. Crash dumps have very little symbol information. It's probably just 6 words from the stack pointer. Whether that matches any parameters (or local variables) needs more research. The only obvious bit of information is the fault address is memcpy + 0xe8

Member Avatar for Iqbal_h_a
0
306
Member Avatar for dmmckelv

> usingnamespace std; It seems that whatever you used to format the code, it's come through on the board as a big mess. If you can still edit your post, I would suggest you do so, and use "post preview" to make sure we're going to see what you're seeing …

Member Avatar for ~s.o.s~
0
103
Member Avatar for degamer106

It would be better to use fgets and sscanf, like [code] char buff[BUFSIZ]; while ( fgets( buff, sizeof buff, fpIn ) != NULL ) { if ( sscanf( buff, "%[^,], %d, %[^,], %d", name, &year, cap, &popRank ) == 4 ) { // success, do something } else { // …

Member Avatar for Salem
0
78
Member Avatar for hariza

> Since '\n' is always the last character in the buffer there is no point using those functions No it isn't. If the line is longer than the buffer, then there will be no \n in there at all, so just trashing the character before the \0 is wrong.

Member Avatar for Dave Sinkula
0
152
Member Avatar for sean25hun

[url]http://www.daniweb.com/techtalkforums/announcement8-2.html[/url]

Member Avatar for Salem
0
303
Member Avatar for rajbasu

Couldn't you just have described the method rather than spoon-feeding the OP an answer. I'm sure that answer is just going to get handed in without any more thought. What are they going to do with their next assignment, just post it here and hope for the same thing.

Member Avatar for Salem
0
125
Member Avatar for martial

Guess you missed this when you rushed into the forum. [url]http://www.daniweb.com/techtalkforums/announcement8-2.html[/url]

Member Avatar for Salem
0
42
Member Avatar for umairsaleem_88

Or save yourself a lot of grief in the long term by downloading a compiler which matches your OS. Say dev-c++, and if you want graphics then grab the libsdl 'devpak' addition. Then visit [url]www.libsdl.org[/url] for examples.

Member Avatar for WaltP
0
114
Member Avatar for sivaslieko++

So what have you tried - or even read about which might suggest what you've tried. I can't even guess as to which language you want this in as yet.

Member Avatar for sivaslieko++
0
483
Member Avatar for Siva_sbj

> for(i=0;i<=100;i++) There are many MANY examples of you accessing outside the bounds of your arrays. more - db[9][7][0]=6686; and more - db_init()

Member Avatar for Siva_sbj
0
126
Member Avatar for sTorM

[INLINECODE]card deck[52];[/INLINECODE] Where card is a type containing 'rank' and 'suit' to specify an individual card. Create functions which work on this array to - initialise: from 2 of clubs to ace of spades in linear order - shuffle: to randomise the deck - deal: take the next card

Member Avatar for Salem
0
80
Member Avatar for d_1386

An excellent example of how not to post a question, if anyone cares. > plz help me plz plz plz plz plz plz Don't sound like an illiterate boob [url]http://www.catb.org/~esr/faqs/smart-questions.html#writewell[/url] > Write a program that can simulate the following CPU scheduling algorithms: Don't beg others to do your own homework. …

Member Avatar for Salem
0
262
Member Avatar for senguptapallab

You'll also need a good solid 6 months of daily study (several hours per day), and a good long stretch afterwards of daily use (say a couple of years) to really hone your skills.

Member Avatar for JoBe
0
147
Member Avatar for kissiwat

1. Use code tags when posting code. 2. NEVER use gets [url]http://faq.cprogramming.com/cgi-bin/smartfaq.cgi?answer=1049157810&id=1043284351[/url] 3. fflush (0); What on earth is this? It may be trying to be fflush(stdin); Either way, it's wrong [url]http://faq.cprogramming.com/cgi-bin/smartfaq.cgi?answer=1052863818&id=1043284351[/url]

Member Avatar for WaltP
0
100
Member Avatar for DynamitMsk

1. AAAA needs 5 characters of storage, not 4 2. Unlike fgets, the count you supply to scanf does not take into account the need for a \0. 3. Trying to use sizeof() with scanf is horrible. There is no easy way to automatically tell scanf what the size of …

Member Avatar for Salem
0
2K
Member Avatar for Kompot

I wonder what the minimum path between being given your assignment and you finding a brower to post your homework on a message board was. My guess is it was a straight line. Take a detour via this [url]http://www.daniweb.com/techtalkforums/announcement8-2.html[/url] then try again.

Member Avatar for Lerner
0
96
Member Avatar for paradoxxx

Please don't tell me that's followed by [INLINECODE]strcpy( cp, tbuff );[/INLINECODE] If it is, it's a bug. There is no space for the \0 at the end of the string. 1. In C++, it would be [INLINECODE]cp = new char[ strlen(tbuff) + 1];[/INLINECODE] 2. If you're REALLY converting it to …

Member Avatar for wildpine
0
183
Member Avatar for Marks256

[url]http://clusty.com/search?query=linux+webcam+howto[/url] Use the "howto" keyword when searching for a lot of Linux information.

Member Avatar for Salem
0
164
Member Avatar for lavicool

> #define SalesPerFile "sper.dat" Seems pretty obvious, this is the name you used inside the program. Simply change it to match the actual name you've given the file.

Member Avatar for ~s.o.s~
0
124
Member Avatar for Barefootsanders

Your second loop should use j as a subscript for your array, not i If you wrote [INLINECODE]for( int i = 0; i < MAXSIZE; ++i )[/INLINECODE] rather than declaring the variable at the start (in C style), then a newer compiler would have made i go out of scope, …

Member Avatar for Salem
0
103
Member Avatar for bala24

Heh, that was an interesting problem. > 1) You do not wish to use ANY local variables at all, so the only variable allowed in the function is the pointer to the string. Check. > 2) Using another function is not allowed. Check. > 3) You want to remove all …

Member Avatar for JRM
0
153
Member Avatar for willy2511

> I'm using the library "memory.h" Now what stone-age-16-bit fossil are you using perchance?

Member Avatar for Salem
0
106
Member Avatar for limergal

> makewords( int a, int b, int c); How does this match your description of a function taking 3 strings? Read up on the string class. There is plenty of functionality to say - find a space in a string - return sub-strings of a string. - get the length …

Member Avatar for limergal
0
112
Member Avatar for Mushy-pea
Member Avatar for Salem
0
100
Member Avatar for superC

> And then came if (i) or if (1234). Is it now one recursion, and how it goes on? The first recursion is i/10, which in integer arithmetic would be rek(123) After a couple more divisions by 10, you end up with a rek(0) call which goes no further.

Member Avatar for superC
0
120
Member Avatar for toomuchfreetime

Like you start with [INLINECODE]int size = 10; int *array = new int[size];[/INLINECODE] And to make it bigger, [INLINECODE]int *bigger = new int[size+10]; // some stuff delete [ ] array; array = bigger; [/INLINECODE] What goes in "some stuff" is an exercise for the reader ;)

Member Avatar for Salem
0
120
Member Avatar for csc Mindy

Looks like you did a [INLINECODE]#include "common.c"[/INLINECODE] when you should have done [INLINECODE]#include "common.h"[/INLINECODE]

Member Avatar for csc Mindy
0
98
Member Avatar for kabrina

In other words, unsolicited marketing emails (or private messages) or whatever else you want to call it. AKA SPAM. Explain the bit which makes it a good idea for me to help you to become a real PITA to me sometime later, because I'm just not seeing what I get …

Member Avatar for jwenting
0
106
Member Avatar for PavelPoooh

Only what [URL="http://www.google.com/search?q=Chkhaidze+Omar"]google tells me[/URL] Next time, use a search engine.

Member Avatar for Salem
0
95
Member Avatar for belhifet

> Does a simple use of fgets protect from buffer overflows Only so long as you're honest about the size of your buffer. [CODE]char buff[10]; fgets( buff, 100, stdin );[/CODE] Isn't any better than gets() OK, it's limited damage compared to gets(), but it's still a hell of a lot …

Member Avatar for Salem
0
295
Member Avatar for JoBe

> [INLINECODE]char month[][12][/INLINECODE] The 12 here is not for the number of months, it is for the length of the longest month name (which has only 9 chars anyway). It also forces "May" to occupy 12 characters as well (not so memory efficient). If you say [INLINECODE] char *month[] = …

Member Avatar for JoBe
-1
149
Member Avatar for marloni

[url]http://www.daniweb.com/techtalkforums/announcement8-2.html[/url]

Member Avatar for ~s.o.s~
0
69

The End.