3,183 Posted Topics
Re: > Can u suggest me how can i create barcode and print. You need a barcode font, there's no getting around that unless you want to encode and draw the barcode manually, which I strongly recommend against. So your first step is finding a font, whether it be free or … | |
Re: > Would make str str? I don't understand your question, but if you're asking whether you want to use the `strstr` function then the answer is yes. `strstr` will return a pointer to the matched string, or `NULL` if it wasn't found. So you can repeatedly call `strstr` and then … | |
Re: `<<` doesn't represent a sequence point, so the example is undefined. | |
Re: Flood control isn't presently enabled for voting, to the best of my knowledge. Dani may have implemented it in a non-obvious way without me noticing though. ;) In light of the recent complaints, I've stepped up the priority of a moderator tool I wanted to write that lets us investigate … | |
Re: There's not really a 'for Dummies' level book because the topic is very complex. The O'Reilly book is probably your best bet for an introduction, and if it's too difficult you're probably lacking in prerequisite education. Perhaps if you point out some parts of the book that are troublesome, we … | |
Re: You can preview the message at any time by clicking on the **Spellcheck/Preview** button on the editor. We also give you sufficient time to edit your post after submitting it. Should you want a post deleted, you're welcome to report it with the **Flag Bad Post** button. This will place … | |
Re: > Step 2. Initialize pos=0. > Step 3. Repeat step 4 till pos<=length. When starting at 0, that implies a half open range. Step 3 is wrong in that it says to repeat *until* pos is *less than* or equal to `length`. In other words, the loop will never run … | |
Re: Think of programming like the martial arts. You can probably learn the basics quickly, but it's not very useful at that level. To reach and maintain a level where it *is* useful, you have to put in a lot of effort. And anyone who tells you it's easy is trying … | |
Re: It's old school templating before C++ supported (or widely supported) templates. I'd question how old your book is if that's an example. It must be *at least* 20 years old. Regardless, not a book you should be learning modern C++ from unless that example is prefixed, suffixed, and bordered with … | |
Re: > && is bitwise AND operator. && is the *logical* AND operator. > & is refrencing operator. & is an overloaded operator in C, but in this case it's the bitwise AND operator. > & cannot be used instead of &&. It can in some places, but you're limited by … | |
Re: You'll need to lock the handle before being able to access the data: h = GetClipboardData(CF_TEXT) ; strcpy( str, (char *)GlobalLock(h) ) ; GlobalUnlock(h) ; | |
Re: Because C wasn't designed to protect stupid people from themselves, it was designed to give smart people a lot of power and flexibility. A potentially dangerous feature can still be used to great effect when used correctly. The unfortunate truth though is that such features are often *not* used correctly. … | |
Re: In general, boolean logic precedence rules place NOT first, then AND, then OR. So in your example, it would go like this: (NOT (X OR Y)) AND Z Or broken down using temporaries: A = X OR Y B = NOT A C = B AND Z Q = C | |
Re: It seems like you don't even have a book or thorough tutorial to work with, which will drastically hinder your progress. I'd suggest buying a book and working through it, as most people won't be inclined to teach you when it seems like you aren't interested in putting any effort … | |
Re: > then whats the difference between using namespace and #include? The two are unrelated. Any confusion you might have about them could stem from thinking that they're somehow comparable in functionality. | |
Re: > hint : use % That's a dead end hint that actually makes the solution more difficult. Instead, consider dividing the semester number by 3 and then taking the ceiling of the result. This will produce the correct year: #include <math.h> #include <stdio.h> int main(void) { int i; for (i … | |
Re: Unless 5+ is closer to 10+ with an outstanding portfolio, you may want to be more realistic. Game development is extremely competitive, and systems development is difficult to get into due to the lack of open positions. Though I'd wager systems developers are better paid in general. | |
Re: Do you know anything about software development? The usual process is to come up with a list of features, then derive a check list of requirements from that, then tests (for test driven development), and then write code to meet the requirements/tests. Rinse and repeat until the death of the … | |
Re: Insufficient information. Were you given nothing else but a vague title for your report? | |
Re: This is a common problem. The easiest solution is to place an input request just before the point at which your program terminates. For example: #include <iostream> int main() { // Do something std::cout << "Hello, world!\n"; // Pause for input std::cin.get(); // Program terminates here } There are cases … | |
Re: The answer is 214. All you need to do is recognize that you're working in base 8 rather than base 10. | |
Re: I'm guessing you don't mean by way of an interactive menuing system, since that's the obvious answer to your question. What exactly are you trying to accomplish? | |
Re: Then use `getchar` instead of `scanf` to read each digit as a character. Much easier: #include <ctype.h> #include <stdio.h> int main(void) { int ch; while (isdigit(ch = getchar())) { switch (ch) { case '0': fputs("zero ", stdout); break; case '1': fputs("one ", stdout); break; case '2': fputs("two ", stdout); break; … ![]() | |
Re: I think you're confused about the string passed to ofstream for opening a file. It's the *file* path, not the folder. So for each *file*, you need to make sure that the folder is included in the path. In other words: std::string name = "outputBOHE " + NumberToString(cr_w) +" x … | |
Re: rundll32.exe is a Windows application that executes shared stuff from DLLs. It's totally legit, so no worries about malware, but if it regularly eats CPU like that while idle you may be looking at a poorly developed DLL that's eating more CPU than it should. You can find out what … | |
Re: [Thread.Sleep](http://msdn.microsoft.com/en-us/library/d00bd51t.aspx) | |
Re: > can you please tell what data was there in $viagens['HoraPartida']. My guess would be a time string in hours and minutes: "hh:mm". A better question would be what result is the OP expecting and how does the code *not* produce the correct result? | |
![]() | Re: > So Now I have 2 infraction points. I don't see which rule i broke. You've been here long enough to know we have a C forum and that C questions go in the C forum. I had to move this thread from Community Center, and thus felt justified in … |
Re: > It's elegant and simple. And not tail recursive, so you can't expect the compiler to optimize that into a loop. Recursion for linear problems is generally a bad idea due to the inherent overhead and risk of stack overflow, so I'd call the "elegant" solution unusable for robust code. … | |
Re: Define "better". Do you want to win contests or be a good programmer in general? Do you want to write professional quality code or code that just solves the problem as quickly as possible, and maintainability be damned? That's the difference between competition and software development. Most of the time, … | |
Re: Unless it was removed during refactoring, there should be the beginnings of such a system that I was working on. But it's not ready yet, and my time is unfortunately very limited, so it may not be finished for a while. For now just notify us through threads such as … | |
Re: Barring the obvious issue of not properly handling the last span of characters unless they're exactly `width` length, I don't see any problems. I'd do a few things differently, but the way you're doing it is functional. Can you provide a sample file as well as an invokation string so … | |
Re: > POLINK: error: Unresolved external symbol 'WinMain'. You're trying to compile the project as a Windows application rather than a console application. Windows applications use a different entry point called WinMain. This is an easy one to fix, just change the appropriate setting for your project to build a console … | |
Re: > Apply electric shocks to your genitals. Kinky. | |
Re: There are a number of issues including: * The list in `main` is never updated. * Your only reference to the list in `insert` is lost during the loop. * A null list isn't properly accounted for in `insert`. Consider the following changes: #include <stdio.h> #include <stdlib.h> struct list { … | |
Re: > but cout and printf is not working. "Not working" is one of the least helpful descriptions of a problem possible. Please be specific about how it's not working. This probably has nothing to do with your project structure and everything to do with failing to include standard headers in … | |
Re: While I understand the end result you want, I'm not sure what you mean by doing it in a separate class. Can you be more specific? | |
Re: I'd also wager that the majority of the traffic drop was spammers using vBulletin tools. But since you keep asking about the traffic drop, Dani, I'm guessing you have a way of rejecting that theory? | |
Re: How general is this intended to be? Because you're looking at essentially a mini-compiler that parses and evaluates mathematical expressions. In other words, it's not exactly a trivial project. | |
Re: I wonder if the underlying validation function got changed. I'll take a look when I get a chance. | |
Re: An exclusion scanset (the `%[^` specifier) won't extract any of the excluded characters, so the stream still contains a comma after `HuffOriginal` is extracted. The simple answer is this: sscanf(buffer, "%[^,],%[^\n]", HuffOriginal[i], HuffSymbol[i]); | |
Re: What's the format of the packet? | |
Re: > i have got 3 rejections yet in directi (second-last round), AMZON(last round) and facebook (first round). how to make myself confident ? Here's a bit of perspective: I wouldn't be surprised if Amazon or Facebook rejected me (and I'm not familiar with Directi). Since you seem to hold me … | |
Re: You don't need the strcat() in this case, just sprintf(): sprintf(f, "N%d", k); Cue everyone telling you to use std::string instead of C-style strings. | |
Re: You want some variant of getch(). However, note that raw input is not portable, so you'll be using something specific either to your compiler or operating system. [This](http://faq.cprogramming.com/cgi-bin/smartfaq.cgi?answer=1045691686&id=1043284392) may help, since I don't particularly feel like writing a raw input example for the umpteenth time. ;) | |
Re: Be more specific about what parts you want help with. Simply posting your assignment is against Daniweb rules because it implies you want your work done for you. | |
Re: > Unsized arrays are allowed in a class, i believe. Only as static members, and even then you must define them elsewhere. Otherwise you're looking at an incomplete type, which is allowed...until you need it to be complete (ie. try to instantiate one). If you can't give your array a … | |
Re: > Isn't there any way of making it directly initializing with the values given in file. After a fashion, yes. I'd move the parsing aspects into an input operator for the class that handles all of the grunt work. Then you can simply say `f >> s1[i];`. As a simple … |
The End.