6,741 Posted Topics

Member Avatar for Jennifer84

>Does this meen that I will change this later when the application is finished ? Yes and no. When you run your application outside of the debugger (assuming you're using an IDE), a relative path will probably use the current working directory to look for files. Assuming you can make …

Member Avatar for Jennifer84
0
140
Member Avatar for bis student
Re: code

>how can I make the last code shorter and more clear . I'd say it's plenty clear, and the only easy way to make it shorter is to drop the switch statement in favor of something like this: [code=cplusplus] // Find the display index of the selected column col = …

Member Avatar for Narue
0
148
Member Avatar for buddyrocks73
Member Avatar for vishalkhialani

I'd suggest always surrounding blocks with braces until you understand the rules. Properly indenting your code according to how your compiler sees things would produce this: [code=cplusplus] if(choiceMenuInput==1) input(); else if(choiceMenuInput==2) return 0; else printf("\n\n\n\n\n ERROR YOU HAVE ENTERED A WRONG CHOICE\n\n\n"); system("pause"); inputedit(); [/code] The last two lines are …

Member Avatar for vishalkhialani
0
106
Member Avatar for Squeeker

>But what about the newlines and/or tabs? Indeed. And what about such monstrosities as "\t \n\n\t"? Does "extra whitespace" refer to adjacent whitespace characters of the same value, any value that isspace returns true for, or are we only working with the ' ' character? The problem doesn't seem to …

Member Avatar for Squeeker
1
1K
Member Avatar for jb7643

The easiest way is to block for input using [ICODE]cin.get();[/ICODE]. However, that only works if there isn't anything left in the stream, which in this case is likely to happen. Change your code to this: [code=cplusplus] #include <iostream> int main() { std::cout << "Enter two numbers:" << std::endl; int v1, …

Member Avatar for jb7643
0
94
Member Avatar for pitbro

>is there a quicker way to fill the list with A,B,C,...,Y,Z whithout doing all this? Yes, put your code to add a new node into a function, then use a loop: [code=cplusplus] int main() { struct node *current = 0; const char *alphabet = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"; for ( int i = …

Member Avatar for pitbro
0
95
Member Avatar for joshSCH

>No, not currently, although you can see more in your >member control panel than is public in your profile. Is there any reason for that? I see rep as completely pointless except for the comments, which I enjoy reading. It would be nice if there could be a link to …

Member Avatar for iamthwee
0
109
Member Avatar for newport

>I'm trying to make a program that converts octal numbers to decimal numbers. I don't suppose this would work for you: [code=c] #include <stdio.h> int main ( void ) { int number; scanf ( "%o", &number ); printf ( "%d\n", number ); return 0; } [/code]

Member Avatar for Narue
0
173
Member Avatar for sgw

>cin.get(sex); This only reads one of the two characters that are in the stream. The second character is '\n'. Conveniently enough, getline uses '\n' as a delimiter, so it's terminating successfully right away rather than blocking for input. Read [url=http://www.daniweb.com/forums/thread90228.html]this[/url] thread for more details on what the problem is and …

Member Avatar for Narue
0
257
Member Avatar for CodeBoy101

>Ho can I get around this? You'll have to learn about working with multiple threads or multiple processes. That's a rather broad and complicated topic for a forum post though, try google.

Member Avatar for CodeBoy101
0
134
Member Avatar for johnRiley

A stringstream is still a stream, you can't just copy a stream as std::vector does for its elements. Try using a pointer/smart pointer if you really want a vector of stringstreams.

Member Avatar for johnRiley
0
3K
Member Avatar for kux

>vector<string> vect; >copy( istream_iterator<string>(is) , istream_iterator<string>() , vect.begin() ); The vector is empty, and copy won't call push_back for you. You need to add a back_inserter to the destination or copy will write to memory that you don't own: [code=cplusplus] copy( istream_iterator<string>(is) , istream_iterator<string>() , back_inserter( vect ) ); [/code] …

Member Avatar for kux
0
170
Member Avatar for monto

>i want to access the addresses other than provided to me c compiler I'll guess that you mean you want to access arbitrary memory addresses. C allows it, but a system with protected memory isn't likely to be happy if you try it: [code=c] #include <stdio.h> int main ( void …

Member Avatar for Narue
0
99
Member Avatar for DangerDev

>Its my dream to work in c or c++ under Linux platform Why? Your dream is a little odd considering that you're not familiar with Linux. I get the impression that you have some kind of idyllic misconception about the difference between Windows programming and Linux programming. It's great to …

Member Avatar for jbennet
0
215
Member Avatar for kv79

>I need to know why the designer of this website put in the software development Because people have questions about software development. >And why is designer of this page must to put web deve... Because people have questions about web development. >i do not know why do i need php …

Member Avatar for peter_budo
0
115
Member Avatar for manimaran_c

Your question can't be answered with the information given. All of those tasks are non-portable and depend heavily on your OS and compiler.

Member Avatar for Narue
0
90
Member Avatar for fskhan

Capitalizing the first letter of every single word makes your sentences harder to read. >I Have Thought Of Shift, Shift-rotate Etc But Can't Figure Out How To Do It You're probably trying to do it in-place and that's confusing you. Try building a whole new value by ORing the least …

Member Avatar for jephthah
0
3K
Member Avatar for sarnath1980

Presumably the problem is designed so that [i]you[/i] can learn how to specify a grammar given a limited syntax. If I solve it for you, you learn nothing.

Member Avatar for ShawnCplus
0
88
Member Avatar for smiles

>but it only display "HELLO WORLD", no "!" sign There's nothing in your code that would cause this. In other words, the loop is correct. I'd guess that you're reaching a limit on the display.

Member Avatar for Narue
0
74
Member Avatar for The Dude

I've looked through your posts, The Dude, and determined that a certain measure of harassment through the reputation system has violated Keep It Pleasant. The parties involved have been dealt with accordingly. If you could send me a list of the posts that have rep you feel was part of …

Member Avatar for Narue
-1
253
Member Avatar for noellieb

>if(find(newItem)!= -1) This doesn't make sense. You're only inserting into the table if the item already exists? :confused: I think you should avoid that confusion altogether and just hash straight from the insert function. >if(find(newItem)!= -1)// call to find index exist >hashVal = find(newItem);// know the position or hash That's …

Member Avatar for Narue
0
822
Member Avatar for Jicky

>Take all the printable/allowable characters and create a random >string with them. The longer the string the better your password. That's the logic for a secure password. A good password is sufficiently secure while still being memorable. Logic for a good password would be a phrase that meets the requirements …

Member Avatar for technogeek_42
0
387
Member Avatar for VersEtreOuNe

The first is legal, the second is not. But if you meant typename rather than typedef, the two are functionally identical.

Member Avatar for VersEtreOuNe
0
252
Member Avatar for inocntreper

>can anybody help me with this? When someone says "can you help?" and only posts an assignment, we tend to assume that they want us to write it for them. Perhaps you should also post the code you've got, and if you don't have any code, try [B]something[/B] before asking …

Member Avatar for JRM
0
94
Member Avatar for Michael Orme
Re: Spam

Are you subscribing to threads for email notification? Go to your Control Panel and under Settings & Options, select Edit Options. Under Messaging & Notification there's a Default Thread Subscription Mode. Make sure it's set to "Do not subscribe" or "No email notification".

Member Avatar for happygeek
0
50
Member Avatar for VIeditorlover
Member Avatar for faisaly

>Is object-oriented approach is closer to the working of human cognition? You mean without training and experience? Closer to the way a human naturally thinks? Judging from how difficult most people find learning OO concepts, I'd say no. >Support your answer with strong arguments and real life examples. As much …

Member Avatar for kishjeff
0
146
Member Avatar for jimmy bones

This is a forum in which you can get help for writing your own code, not a service that provides code to you.

Member Avatar for Phaelax
0
110
Member Avatar for mayank24
Member Avatar for Narue
0
40
Member Avatar for mayank24
Member Avatar for DangerDev
0
133
Member Avatar for Demond

GoTo only works within a method, you can't jump between methods. Maybe if you describe why you want to do this, we can offer a better solution.

Member Avatar for Demond
0
143
Member Avatar for atish00

How about posting actual code so we know what advice to give you. :icon_rolleyes: >corr[8]="pizzaboy"; error-- cannot convert char* to char Presumably corr is declared as [ICODE]char corr[N];[/ICODE], which means that corr[8] has type char, not char*. >corr[]="pizzaboy"; error-- char has zero values Presumably this isn't a declaration. >corr[2]="z" ----- …

Member Avatar for Ancient Dragon
0
465
Member Avatar for briansmall

I don't like your options. "good enough" rarely is, and perfection is usually a pipe dream. How about "good enough" versus doing it right? In that case I'd pick doing it right regardless of the time frame.

Member Avatar for Lardmeister
0
124
Member Avatar for mmcshmi11

Use sprintf to convert the number to a string and then print all but the first character: [code=c] sprintf ( buffer, "%d", value ); puts ( &buffer[1] ); [/code]

Member Avatar for invisal
0
116
Member Avatar for awelex

>I was thus wondering if there's a way to "convert" a >va_list so that it can be used with a printf-like function. No, a variable argument list and a va_list object are directly equivalent to an object of type T and a pointer to type T, respectively. The types are …

Member Avatar for Narue
0
260
Member Avatar for johnRiley

>Is there any way of proving that the += operator is more efficient than the + operator... Sure. Look at it and say "Hey, A is being evaluated twice with the + operator but only once with the += operator" and "Hey, A + B is probably making a temporary …

Member Avatar for vijayan121
0
134
Member Avatar for boyet1970

>dev c++ and codeblocks seem to be dead now That's an odd statement to make when the most recent build of Code::Blocks was...today.

Member Avatar for TimeFractal
0
110
Member Avatar for poojagupta

>it goes in a infinite loop Because you're reading integers and not handling the commas: [code=c] fscanf(fp,"%d",&ch); [/code] This will always try to read a valid integer. fscanf doesn't find a valid integer, it'll fail and leave the offending character on the stream. ',' is not a valid integer character, …

Member Avatar for Narue
0
114
Member Avatar for gReen_aXe

>Why i must enter ctrl+z 2 times to out from the loop..? The Windows shell has trouble handling EOF properly unless it's the first character on the line. Most likely you're doing something like this: [code] this is a test^Z ^Z [/code] The program only stops at the second ^Z …

Member Avatar for Narue
0
151
Member Avatar for jokerjokerer

>Never heard of wofstream or Codecvt Facet wofstream is the wide character variant of ofstream. codecvt is basically meant for converting between different character encodings. >Any ideas why ? And mainly how to fix it ? I'd say that you either don't have Boost installed, didn't include the correct header, …

Member Avatar for jokerjokerer
0
208
Member Avatar for technogeek_42

>the stuff you can do in C can be done in C++, except build an O/S. Nope, you can do that in C++ too. C++ can be used anywhere C can, provided there's a compiler available for the target machine.

Member Avatar for Ancient Dragon
0
280
Member Avatar for winrycool

>wow... can that be done in c++?? If it can be done at all, it can be done in C++, with one or two exceptions. >can someone tell me which API's to use for this?? Start with Allegro. It's relatively straightforward and easy to learn.

Member Avatar for Narue
0
249
Member Avatar for blcase
Member Avatar for Narue
0
2K
Member Avatar for spyrilautte

>Can anyone shed some insight on >cin.reset()? Does it really exist? No. By "reset", hopefully your professor meant for you to [url=http://www.daniweb.com/forums/thread90228.html]flush[/url] it. >Am I worrying about the exact wording of my prof's algorithm too much and just use You are, but he also didn't really communicate the task to …

Member Avatar for spyrilautte
0
3K
Member Avatar for ShyamalShah

>a formula for computing the day of the week on which a given date fell or will fall. Wow, deja vu.

Member Avatar for neosomosis
0
111
Member Avatar for IIMarckus

>using namespace std; >is required for u 2 be able to use cin only No, it's not. You have to qualify for the std namespace to use any standard name, but a using directive isn't the only way to do it. In fact, it's probably the worst way to do …

Member Avatar for IIMarckus
0
140
Member Avatar for Blythe24

Okay, let me see if I understand your problem. You're basically writing an odometer where the characters on each wheel are specified by the first input string and the both the number of wheels and starting combination are specified by the second input. Then you need to print the combinations …

Member Avatar for Narue
0
85
Member Avatar for cpp_noobsauce
Member Avatar for Agni

>what do u guys think?? How about this? If you exceed 500 posts (Coffee House doesn't count), 50 solved threads, and maintain at least 4 green rep blocks, I'll give you one "get out of jail free" card. That means if you somehow accumulate enough infractions to be automatically banned, …

Member Avatar for Ezzaral
0
112

The End.