6,741 Posted Topics

Member Avatar for aiwasen

It's certainly possible, how do you think the operating system itself works? ;) However, without the aid of an OS, you might find yourself writing a lot of plumbing to work directly with the hardware.

Member Avatar for johnmiller48
0
85
Member Avatar for techie1991

[QUOTE]Now, would this work?[/QUOTE] What an odd question. Why don't you write up a quick test to see if it works? If it does, then try to break it with pathological cases.

Member Avatar for JeffGrigg
0
140
Member Avatar for Dani
Member Avatar for Cross213
Member Avatar for Cross213
0
234
Member Avatar for MrAppleseed

If you use a console application, that will use the console subsystem. If you use a windows (win32) application, a console won't be created for you and your GUI will load alone. I don't recall off the top of my head if Code::Blocks has win32 project templates, sorry.

Member Avatar for gusano79
0
1K
Member Avatar for peter_budo

>People did any of you come across good tutorials on hash tables??? No, I never came across a good tutorial on hash tables. So I [url=http://www.eternallyconfuzzled.com/brain.html]wrote one[/url]. :)

Member Avatar for Siddhartha_90
0
493
Member Avatar for yni420

[QUOTE]is that allowed?[/QUOTE] It's usually wise to ask that question [i]before[/i] starting your thread and having it shot down with an infraction. And no, as the infraction PM you received clearly states, advertising your services constitutes spam.

Member Avatar for Narue
0
134
Member Avatar for pseudorandom21

[QUOTE=pseudorandom21;1579352]Not to promote the use of alcohol, but it is in most places legal at least. Well I turned 21 a few months ago, so I'm wondering what everyone else drinks when relaxing on their off days? I like: Miller Lite Bud Light Other non-traditional (non-mass-produced) beers like dos equis, …

Member Avatar for Niles64
0
331
Member Avatar for logicmonster

[QUOTE]Is it even possible to create a singly linked list using a function outside of main and then access it once you leave the function?[/QUOTE] Um, yes. If that weren't possible, linked lists in C would be rather useless, no? [code] #include <stdio.h> #include <stdlib.h> struct node { int data; …

Member Avatar for Narue
0
1K
Member Avatar for coril

[QUOTE=coril;1626152]By error, I should have been more specific, it compiles but when it runs, it doesn't work as intended (skips the next scanf()). getchar() also solves the problem.[/QUOTE] Which doesn't invalidate the advice to avoid calling fflush() on input streams. getchar() solves the problem as well, but you might consider …

Member Avatar for Narue
0
1K
Member Avatar for manugm_1987

You can start [url=http://msdn.microsoft.com/en-us/library/aa364963(v=vs.85).aspx]here[/url].

Member Avatar for Ancient Dragon
0
152
Member Avatar for teha_toshio
Member Avatar for teha_toshio
0
174
Member Avatar for tubby123

[QUOTE]cuz worst case it requires n swaps for each of the n elements[/QUOTE] How do you figure that?

Member Avatar for Narue
0
85
Member Avatar for Hendo

What's the purpose of this program? Knowing the use cases can help greatly in figuring out what strategies would work best for locking down functionality.

Member Avatar for Hendo
0
116
Member Avatar for bd338

[QUOTE]I'm not trying to write a computer virus, or trying to learn how to crack software illegally![/QUOTE] That may not be [I]your[/I] intention, but this is a public forum. How can you guarantee that what you learn in this thread can't be taken by others and used for malicious purposes? …

Member Avatar for Narue
-1
614
Member Avatar for thompsonSensibl

[QUOTE]Yes, the obvious answer is, "take as much of the most valuable powder as he can"; yes, but how do you determine that, mathematically?[/QUOTE] Is there a variable for powder value, or are you simply using size?

Member Avatar for Momerath
0
86
Member Avatar for tarakant_sethy
Member Avatar for tarakant_sethy
0
100
Member Avatar for logicmonster

Parse errors can be confusing, but if you posted your code exactly as it is, the declaration of open_file() in your header is missing a semicolon at the end. Since headers are textually inserted into the translation unit, this [code] #include "functions.h" int open_file(int argc, char argv[], int count) { …

Member Avatar for Ancient Dragon
0
168
Member Avatar for banoth suman

[QUOTE][CODE]num = atoi(word.c_str());[/CODE][/QUOTE] I realize you didn't compile or test, but atoi() is declared in <cstdlib>, and it's in the std namespace. I assume you're using Visual Studio because it's pretty lenient about requiring namespace qualification on the C-inherited library. On a side note, atoi() is evil. Unless you validate …

Member Avatar for Ancient Dragon
0
252
Member Avatar for detailer
Member Avatar for Marvin Danni

[QUOTE=Marvin Danni;1624153][CODE]#include <iostream> #include <string> using namespace std; int main(){ string str = "Gregory"; int k = 0; for (k=0; str[k]!='\0';k++){ if (str[k]>=65 && str[k]<=90) { str[k]+=32; } } cout << str << endl; } [/CODE] is this code right[/QUOTE] No. Ignoring your assumptions about the character set, std::string is …

Member Avatar for Narue
0
123
Member Avatar for dotancohen

[QUOTE]Is "ip is a pointer to int" (the type) or is "ip a pointer to an int" (a particular variable of type int)?[/QUOTE] If you want to get specific, "ip is an object with the type pointer to int". An object has a type. The object is a concrete entity …

Member Avatar for keshvari
0
197
Member Avatar for stereomatching

[QUOTE]looks like c could make generic programming come true but it could be very tedious[/QUOTE] Not to mention type unsafe, which you can assign evilness to according to your beliefs about type safety. ;) [QUOTE]and much more harder to maintain than template[/QUOTE] Clearly, which is why templates were added to …

Member Avatar for nezachem
0
1K
Member Avatar for siddiqui_1985

[QUOTE=HASHMI007;1618988][code] #include<stdio.h> #include<conio.h> void main() { clrscr(); char name[50]; int i,j; printf("Enter Name : "); scanf("%s",name); printf("\n%s",name); getch(); } [/code][/QUOTE] And the point of this post is what exactly? You completely failed to answer the question, or solve the stated problem, and you didn't fix any of the other problems …

Member Avatar for HASHMI007
0
159
Member Avatar for tubby123

[QUOTE]Couldnt this have been made much simpler if[...][/QUOTE] Yes, it could have. But like many features with the label "nice to have", the critical mass necessary to get it into the language specification wasn't ever reached. You might find a compiler that supports something along these lines as an extension …

Member Avatar for Narue
0
89
Member Avatar for tubby123

[QUOTE]Since its the same file, we dont have to do a #include"samefile.h"[/QUOTE] Since headers provide declarations, and the extern declaration already does that, including a header at all is unnecessary. You can still have two files: [code] /* foo.c */ int a = 20; [/code] [code] /* main.c */ #include …

Member Avatar for Narue
0
94
Member Avatar for Mr.UNOwen

[QUOTE]I want the child class to overide it such that when the parent calls setupBuffer() it calls the child's version. Should either be virtual?[/QUOTE] If you're overriding a parent class member function's behavior in a child class, it should probably be virtual. [QUOTE]Another situation is when I want the child …

Member Avatar for mike_2000_17
0
367
Member Avatar for logicmonster

[code] #include <iostream> #include <sstream> #include <string> int main() { std::string filename = "myfile_"; for (int i = 1; i < 10; i++) { std::ostringstream oss; oss << filename << i; std::cout << oss.str() << '\n'; } } [/code] Edit: My bad, I didn't realize this was the C forum. …

Member Avatar for logicmonster
0
462
Member Avatar for sydsine

Given an array [ICODE]a[M][N][/ICODE], [ICODE]a[i][j][/ICODE] is logically equivalent to [ICODE]a[i * N + j][/ICODE] if the dimensions are stored in sequence.

Member Avatar for sydsine
0
102
Member Avatar for sasho648

You're entering the realm of concurrency. For example, you might create one thread to handle user input while another handles the timer.

Member Avatar for sasho648
0
313
Member Avatar for YungSoprano

Did you include ? Do you have a using directive for std using namespace std; or a using declaration for each standard name using std::cout; using std::cin; at appropriate locations?

Member Avatar for YungSoprano
0
609
Member Avatar for goco17

[QUOTE]is it possible to have a back() in stack....i know queue and vector has it...[/QUOTE] For the standard container adapter, no. Check any reference and you'll see that the exposed non-boilerplate methods are push(), pop(), top(), and empty(). However, std::stack is an adapter for an existing container (the default is …

Member Avatar for jonsca
0
4K
Member Avatar for farhanrocks

Sorry dude, but we're not sympathetic toward people who go through N years of school and still can't come up with a something as trivial as a [i]topic name[/i]. One has to work really hard to be that helpless.

Member Avatar for Rashakil Fol
-3
287
Member Avatar for Zoe123
Member Avatar for WaltP
0
206
Member Avatar for Amr87

[QUOTE]1- what is the difference between web developer and web coder ?[/QUOTE] Terminology. [QUOTE]2- should a web developer study computer science deeply , before starting a career & why?[/QUOTE] Why wouldn't they? Sure, web developers are sometimes viewed as short bus window lickers compared to applications developers or systems developers …

Member Avatar for Amr87
0
79
Member Avatar for imstarting

[QUOTE]Anybody have experience in learning from video tutorials?[/QUOTE] I haven't seen any that were worth a damn.

Member Avatar for m4ster_r0shi
0
249
Member Avatar for rhyza

When it comes to alignment, just play with the different setw() values until you get what you want. Alternatively, you could show the votes horizontally instead of vertically. That simplifies a lot of things.

Member Avatar for Narue
0
93
Member Avatar for Muralidharan.E

[QUOTE]The "new" doesn't execute until absolutely necessary.[/QUOTE] That would be difficult to implement in any useful manner. Perhaps you're thinking of lazy initialized objects? That has the behavior you're talking about, but it's a part of the class implementation rather than the compiler.

Member Avatar for Fbody
0
596
Member Avatar for Falcon143

[QUOTE]without using predefined macros[/QUOTE] What is with you people asking a question and then immediately rejecting the best solution? What do you think the __LINE__ macro was designed for?

Member Avatar for nmaillet
0
2K
Member Avatar for SETHU S

[URL="http://catb.org/~esr/faqs/smart-questions.html"]How To Ask Questions The Smart Way[/URL].

Member Avatar for Tomtommitom
0
124
Member Avatar for kantaki

The good news is that your case is pretty trivial because firefox supports command line arguments. So you can simply invoke a command line string: [code] #include <cstdlib> std::system("firefox.exe \"http://www.daniweb.com\""); [/code]

Member Avatar for Narue
0
88
Member Avatar for danieldane

[QUOTE]The problem is, when I try to DELETE PERSONAL PROFILE. I can delete it but the PROFILE number still there. I want it to be deleted also when I delete the data.[/QUOTE] You need to do one of two things to truly erase the data: [list] [*]Overwrite the record in …

Member Avatar for rubberman
0
203
Member Avatar for bhavna04
Member Avatar for Transcendent

[QUOTE]If someone request a B than I'm supposed to print a C. If someone request a C I print D.[/QUOTE] What a cynical design. So you'll always assume that the student is lying to get a better grade, always deserves a lower grade, and an A will never be given? …

Member Avatar for Narue
0
129
Member Avatar for emmas4impact

[QUOTE]So what you're saying is you defined d as a global variable of some indeterminate type[/QUOTE] Though there's a good enough chance of it being [ICODE]struct tm[/ICODE] that you can safely make that assumption rather than acting like a pedantic douche. ;) [QUOTE]changing gets() to gets_s() is a bandaid rather …

Member Avatar for Narue
0
152
Member Avatar for opawix

What you probably want to do is accept any character in the loop, but only print it if it matches the criteria: [code] while (cin >> letter) { if (is_vowel(letter)) cout << letter; } [/code] Obviously this is a non-working example that you would need to flesh out (such as …

Member Avatar for opawix
0
146
Member Avatar for dashure

I'm somewhat confused about this design. Why make CWorker's constructor a friend of CCar when you can simply construct a new CCar? [code] #define LEN_N_W 20 class CWorker { char m_name[LEN_N_W]; CCar m_Car; public: CWorker(const char *name, const char *firma = "",int price = 0); void showWorker(ostream& out)const; }; CWorker::CWorker(const …

Member Avatar for dashure
0
112
Member Avatar for Shy01
Member Avatar for mrnutty
0
140
Member Avatar for hqt

If I'm reading your post correctly, you want to change how the watch window in your IDE shows arrays? I'll go out on a limb and say that you're SOL unless you want to write a plugin to alter the behavior.

Member Avatar for hqt
0
356
Member Avatar for Zvjezdan23

The End.