6,741 Posted Topics

Member Avatar for theCompiler

On the assumption that you're using Turbo C, please make sure that your linker settings include the graphics library.

Member Avatar for D33wakar
0
684
Member Avatar for fullarmorzz
Member Avatar for ashok1514
0
153
Member Avatar for meli123

How many threads are you going to start asking essentially the same question?

Member Avatar for Taywin
0
279
Member Avatar for sunny124

[QUOTE]I'm getting a error msg: 'cannot convert sprites* to sprite_data** in assignment'[/QUOTE] Your name choices are confusing you. [ICODE]blocks[/ICODE] is defined as being a pointer to [ICODE]sprite[/ICODE], which the error suggests is a typedef for a pointer to [ICODE]sprite_data[/ICODE]. This is very different from the [ICODE]sprites[/ICODE] typedef, which is a …

Member Avatar for sunny124
0
134
Member Avatar for marirs07

[QUOTE]can i request the moderator to delete an thread i've posted?????!!!!!![/QUOTE] Feel free to report the thread (use the Flag Bad Post button) along with a reason for why you want it deleted/edited and we'll review it. You can always request moderation of any kind, but unless there's a clear …

Member Avatar for Netcode
0
180
Member Avatar for nick.crane

I may have a slightly better idea. Instead of making the new thread button more prominent, how about placing a date check script on the reply buttons? If the thread is older than N days, a nuisance popup could be used. The popup would give posters the option of creating …

Member Avatar for ggeoff
4
233
Member Avatar for jingda

Links in your signature do not by themselves count as spam. It's only if you post with the sole intention of promoting your signature that they count as spam. This is a difficult pattern to nail down accurately, so if you have links in your signature, you might find otherwise …

Member Avatar for jingda
0
176
Member Avatar for Zeref

[QUOTE=Lordvivi;1656616]You can also use this [CODE=c] scanf("%c",&aChar); fflush(stdin); /*It clears the input*/ [/CODE][/QUOTE] No, it's wrong because fflush() is only defined for [U]output[/U] streams. Just because it happens to work for you doesn't mean it's correct.

Member Avatar for Narue
0
215
Member Avatar for dev90

[ICODE]i[/ICODE] and [ICODE]j[/ICODE] will never be equal when the item count is even. You're swapping both halves of the array in that case, which ultimately produces the original sequence. Perhaps instead of using that weird logic for your swapping loop, just use the relationship of [ICODE]i[/ICODE] and [ICODE]j[/ICODE] as the …

Member Avatar for Narue
0
3K
Member Avatar for oseijy

Find an area with free Wi-Fi. For example, in the United States it's hard [I]not[/I] to find commercial areas (McDonalds, Starbucks, etc...) that offer Wi-Fi as a free service to attract more traffic and hopefully sell product as a result.

Member Avatar for Netcode
0
24
Member Avatar for himanshu091

[QUOTE]I heard if i dont have 3 yrs experience in java i wont be able to get a job easily.[/QUOTE] Given the job market in many places, you may find it hard to get a job regardless of experience. But what you heard is wrong, not all jobs require the …

Member Avatar for Netcode
0
221
Member Avatar for reojavier

Forgive me if I'm confused, but from the look of your code, you should be well aware of how to calculate the mean from an array (I assume you're talking about the arithmetic mean): [code] #include <math.h> #include <stdio.h> #include <stdlib.h> #include <time.h> #define N 50 double mean(int a[], int …

Member Avatar for reojavier
-1
926
Member Avatar for marirs07

[QUOTE=marirs07;1656111]offsetof cannot be used in this case because u dont know the member's name but only the address of that member :([/QUOTE] Whoever gave you this exercise is either mistaken that it's possible, or expecting a non-portable hack. Either way, you need to get clarification, because within standard C there's …

Member Avatar for Narue
0
159
Member Avatar for functionalCode

Academic purposes or not, information on exploiting buffer overflows constitutes hacking, which is against Daniweb's rules. I'm sorry.

Member Avatar for Narue
0
143
Member Avatar for silvercats
Member Avatar for wnr78ta

[QUOTE]Does every name have to not start with an underscore? Uh.. well yes![/QUOTE] No, but it's a good guideline if you haven't memorized the rules for when and when not to use leading underscores. [QUOTE]It does break the idiomatic use of T and it does not provide a very descriptive …

Member Avatar for wnr78ta
0
337
Member Avatar for Tenjune

If by "help" you mean "do it for me", kindly go away. Otherwise, please give us some evidence that you've attempted to solve the problem on your own and help will be provided.

Member Avatar for N1GHTS
0
76
Member Avatar for dospy

[QUOTE]i ask this cuz i'm not sure if it's worth learning to use command line arguments or not[/QUOTE] Command line arguments are very simple and worth knowing. For example: [code] #include <iostream> #include <string> #include <vector> int main(int argc, char *argv[]) { // Store the arguments in a more convenient …

Member Avatar for dospy
0
2K
Member Avatar for FinaL111

[QUOTE]And have you understood the format of the file yourself? if so, do you mind explaining it to me.(since OP doesn't seem to interested in explaining that, he has got his own problems).[/QUOTE] It looks to me like an NxN matrix defining the word search followed by the words hidden …

Member Avatar for FinaL111
0
278
Member Avatar for falconmick

If you can suffer the extra storage cost while building the tree, place all of the pointers into an array initially, shuffle the array randomly, [i]then[/i] do the insertion: [code] { std::vector<mesh_t> v(62500); std::fill_n(v.begin(), v.size(), next_mesh()); std::random_shuffle(v.begin(), v.end()); for (auto mesh : v) tree.add(mesh); } [/code] Given a basic binary …

Member Avatar for mike_2000_17
0
439
Member Avatar for Xide

[QUOTE]Your instructor will get there eventually.[/QUOTE] If he's lucky. More likely is that his instructor will go through the gamut of lower level and error prone C-style solutions, and only mention the "STL" in passing.

Member Avatar for mrnutty
0
167
Member Avatar for Phaelax

>Can't seem to figure this out. You're not the only one. There isn't a portable way to get the size of a dynamically allocated array. You need to pass the size to your function: [code] void addNodes(string names[], size_t size) [/code]

Member Avatar for Diego.Corso
0
27K
Member Avatar for vedro-compota

There's no prototype in scope for simple_readline() when you use it, and the arguments you provide, while compatible, don't exactly match the definition. The fix is to add a prototype for simple_readline() before main().

Member Avatar for vedro-compota
0
244
Member Avatar for nirnal
Member Avatar for Netcode
0
111
Member Avatar for gauravrishi

We're not here to do your homework for you. Please show that you've put some effort into doing these exercises on your own.

Member Avatar for cse.avinash
0
186
Member Avatar for geeksforgeek

[QUOTE]A character variable largest integer value is 127.[/QUOTE] Assuming CHAR_BIT is 8 and vanilla char is signed. [QUOTE]Once it reaches 127(the character variable) the value will wrap around to the lowest values which is -128.[/QUOTE] That's an implementation detail. The C standard says that overflowing a signed quantity will invoke …

Member Avatar for Narue
0
104
Member Avatar for coolbeanbob
Member Avatar for Jessurider

You can't change your own name, but if you tell us what you want your named changed to, one of the admins can do it for you (assuming the name isn't already taken).

Member Avatar for Netcode
0
40
Member Avatar for OblibSystems

[QUOTE]Basically the time old question of who would win.[/QUOTE] Including the time old mistake of no context. Language comparisons without context are pointless.

Member Avatar for ddanbe
0
440
Member Avatar for Master Mascus

Note that simply posting a homework assignment is against our rules. We require that you show some effort in solving the problem yourself.

Member Avatar for Master Mascus
0
169
Member Avatar for D.M.

Comparison is done with [ICODE]a == b[/ICODE], assignment is done with [ICODE]a = b[/ICODE].

Member Avatar for Narue
0
108
Member Avatar for sunny124

[QUOTE]Can anyone see what I am doing wrong?[/QUOTE] Yes, and I can illustrate the issue in a test program for you: [code] #include <stdio.h> void reset(int value) { value = 123; } int main(void) { int x = 0; reset(x); printf("%d\n", x); return 0; } [/code] [ICODE]value[/ICODE] is a copy …

Member Avatar for Narue
0
186
Member Avatar for murnesty

You haven't provided sufficient details about the software requirements. What is "progress"? What information are you logging? How will the logs be used? You mention limited memory, which suggests some form of mobile or embedded device, but the program allows multiple students? Am I correct in assuming that the program …

Member Avatar for Narue
0
155
Member Avatar for resell4

[QUOTE]I need recommendations on a good C book.[/QUOTE] For what purpose? Do you need a good reference? A good beginner's tutorial? Advanced topics? Algorithms and data structures using C?

Member Avatar for ashok1514
1
161
Member Avatar for elmar01

Are we talking about the full range of int, or just the ten decimal digits? The latter is trivial while the former is not.

Member Avatar for WhiZTiM
0
158
Member Avatar for jayesh.rocks
Member Avatar for top_coder
Member Avatar for weakprogrammer

[QUOTE]I was thinking that I either need an if statement or a do while loop but i'm stumped.[/QUOTE] You're thinking in terms of code. Try jumping up a level and think in terms of steps. If you have a bag full of each kind of coin, how would you make …

Member Avatar for Narue
0
198
Member Avatar for Aman6o

Break it down: [code] int a[5] = { 5, 3, 15, 20, 25 } ; int i, j, k = 1, m ; a[1] = a[1] + 1; i = a[1] ; j = a[1] ; a[1] = a[1] + 1; m = a[i] ; i = i + 1; …

Member Avatar for Narue
1
146
Member Avatar for Ich bin würdig

[QUOTE]How could I make the input (password) invisible?[/QUOTE] You probably don't really want to make it invisible because that's not as user-friendly as it could be. A generally accepted way to accept passwords is by masking the characters: [code] char *get_password(char buf[], size_t n) { size_t i; for (i = …

Member Avatar for Narue
0
173
Member Avatar for xxmp

[QUOTE]Is there a way to do this in c?[/QUOTE] In standard C, the short answer is no. The long answer is that you can do it with a lot of fuss and bother, but ultimately it isn't worth the effort for a weak facsimile of function overloading. The alternative answer …

Member Avatar for xxmp
0
130
Member Avatar for sucram

Here's one possible implementation of diwakar's algorithm: [code] #include <ctype.h> #include <stdio.h> int is_finished(void) { char line[BUFSIZ]; fputs("Again? (y/n): ", stdout); fflush(stdout); return fgets(line, sizeof line, stdin) == NULL || toupper(line[0]) != 'Y'; } int main(void) { do { puts("Doing stuff..."); } while (!is_finished()); return 0; } [/code]

Member Avatar for Narue
0
160
Member Avatar for OblibSystems

[QUOTE]I am aware that it can be a slow programming language[/QUOTE] Any programming language can be slow in the wrong hands. Java is notorious for being slow not because it's actually slow, but because it's accessible. Java is easy to learn and it's easier to write complex software without a …

Member Avatar for OblibSystems
0
295
Member Avatar for soundar

Strong bump. I doubt the OP is still around after seven years given his single post.

Member Avatar for N1GHTS
0
120
Member Avatar for server_crash

>why is it static? Primarily so that the JVM doesn't have to instantiate your controlling class to get an entry point into the program.

Member Avatar for Taywin
0
600
Member Avatar for Maureen

get/set methods should be used judiciously. As it is, you could simply make your members public, remove the get/set methods, and the effect would be the same with less code.

Member Avatar for manjushreekaran
0
3K
Member Avatar for Majestics

The language you use is irrelevant as long as it has sufficiently low level access to hook into the necessary information. Traditionally, C, C++, and assembly language have been used for exploits, but I've seen (and written) successful exploits using higher level languages. It's all about having enough power to …

Member Avatar for diafol
0
199
Member Avatar for toebs

Provided you don't have to deal with a true CSV format with quoting rules, parsing the file is trivial: [code] #include <stdio.h> int main(void) { int value; while (scanf("%d", &value) == 1) { printf("%d\n", value); if (getchar() != ',') break; } return 0; } [/code] Is this what you were …

Member Avatar for toebs
0
239
Member Avatar for cse.avinash

[QUOTE] and also for the code [CODE]int main(void) { int i=0; printf("%d",++i + ++i + ++i); }[/CODE] why output is 7 ?[/QUOTE] It's undefined behavior because you're modifying an object multiple times between sequence points. The output could be anything. [QUOTE]but what about sizeof("A")[/QUOTE] It's the size of an array …

Member Avatar for gerard4143
0
97
Member Avatar for chezkaty

[QUOTE]I hope this one works.....[/QUOTE] If you test code before posting it, you wouldn't have to hope.

Member Avatar for Narue
0
159

The End.