@# Quotes DB     useful, funny, interesting





Google
 
Web www.quotesdb.info
Undernet  |  EFnet  |  Quakenet  |  Freenode  |  Dalnet  |  Ircnet  |  Galaxynet
Page: 1 2 3



Comments:

<0> hi
<0> how can I input this:" (09) 123456 " without the bracets
<1> ?...
<0> I have in a file as the form "(09) 123456" and I want to output it as "09 123456"
<1> input it where? why? how?
<1> do you know anything about File I/O in C++? does your book have a section on it you might read?
<0> I selectively want to remove character lying between numbers
<0> I tried thre
<0> there is only the .ignore
<0> but it doesnt help in this case
<0> I cant selectively choose what characters to keep and what characters to input in sequence of integers having some sort of characters between them such as (09) 123456
<0> the "(" and ")"
<0> how can I discard them while inputing from a file?
<0> does anyone understand what I mean?
<0> can someone help?
<1> how are you reading from the file at the moment? it's not overly hard



<1> just read a string using >> then trim off the first and last characters using erase or substr or whatever..
<1> std::string has lots of methods that you could use for that task
<0> I am using C
<0> I'll try
<0> thanks anyway
<1> so why are you here in #C++?
<0> is there a channel for c?
<2> can you set two variables with one cin<<?
<2> *cin>>
<3> sure
<2> how?
<4> int i, j; cin >> i >> j;
<2> thanks
<2> when using " while (yn == 'y' or yn2 == 'yes') {" the debugger (using dev-c++) says "no match for 'operator==' in 'yn2 == 7955827'" why does it do this?
<2> and how can i get it to work so that when people write y or yes it will do the while loop? :|
<3> post the whole thing somewhere
<3> has yn and yn2 been declared?
<2> they get declared with cin...
<2> Cancel - the pastebin doesnt let me paste my code
<3> dont ya think maybe ya should declare them before you try to cin something into them?
<2> oh, they are declared yeah. char yn; string yn2;
<2> sorry got confused :|
<2> nah done it now... i changed it to yn2 == "yes"
<2> i'm trying to make sure what is seen in is an int, and "if (yn != int) {code}" but it doesnt work, is there a way to check if what is entered is an int?
<5> entered?
<5> entered from what?
<2> from the keyboard?
<3> well if its declared an int it cant really be anything else can it?
<2> it's not declared as an int, it's declared a string. but when numbers are put in it just goes into a mental loop
<5> "put in"?
<5> the keyboard cannot read into numbers in C++
<5> you have objects such as std::cin that can read numbers, however
<3> aah got ya
<3> orlux: I'd say regex or type conversion with an exception if it isnt what you want
<5> orlux, look up the members of std::cin
<5> std::cin will report an error if it attempted to read into an integer but did not receive one
<5> I think you can check like this
<5> int i;
<5> std::cin >> i;
<3> you can still put a letter there
<3> try it
<5> if(!std::cin) { std::cout << "Please enter an integer"; }
<3> it will just give a value for the number
<5> yes, but cin will report an error
<3> didnt for me
<3> just did it
<5> um
<5> what method are you using to check the condition on std::cin?
<3> none
<3> I just did
<5> there are a number of methods cin has to report error conditions
<5> wtf
<5> you aren't listening to me
<5> you don't just USE the value
<2> nah i changed it so it would exit instead of go into that loop with else { cout << "Invalid argument\n\n"; Sleep(1000); exit(0); }
<3> int myvar;
<3> std::cout << "Enter number!" << std::endl;
<3> cin >> myvar;
<5> you check the error condition on std::cin, and if there IS NO ERROR CONDITION, you can use the results
<3> and I entered a letter
<3> no errors



<6> Xiphoris: nobody listens
<5> Cancel, you ****ing moron
<5> I said you check the error condition on std::cin
<3> possibly
<6> to you, or anyone else
<5> you aren't doing that
<3> aah gotcha
<5> std::cin has methods that report whether an error occurred
<5> I'm not talking about exceptions
<3> didnt say you were
<5> look up std::cin and look at its public methods
<5> [19:19] <3> no errors
<5> you weren't even CHECKING the error conditions, you don't even KNOW if there were errors
<2> it's 19 o clock? :|
<5> how do you know if there were errors if you didn't check for them?
<3> Xiphoris: yes got that
<3> hence the
<3> <5> you aren't doing that
<3> <3> aah gotcha
<5> http://www.cppreference.com/cppio/index.html
<5> that is a reference of the public members of stream cl***es
<5> I think you can just do if(!cin) { // the last input was bad
<5> there are a bunch of them, such as fail(), good(), eof(), bad()
<5> and I don't remember what they all mean
<5> the operator ! is some logical combination of the error conditions
<5> in any case
<5> istream instances will not throw exceptions AFAIK
<3> didnt say they would
<3> saying ya can make your own
<5> however, if you read input from them and something goes wrong (such as reading into an integer and user enters a letter) they will report an error condition
<3> hence the "or"
<5> int i;
<5> std::cin >> i;
<5> if (cin) { // input is ok }
<5> else { // input is bad }
<2> which is what i did
<7> I'm looking for some info regarding the way to customize Win32 windows...My goal was to define my own window...Some know good link for that case..?
<8> customize in what sense?
<8> if you want to provide different functionality for other windows that your own application did not create, you will have to subcl*** them with SetWindowLong, GWL_WNDPROC and your own window procedure (that calls CallWindowProc eventually)
<8> this also applies to customizing other windows' appearance
<7> humm...
<7> the windows apparence like...Spyware doctor...The main window...
<7> A custom window...
<7> With not the standard API conmtrol...
<7> shape...Form...fucntion..
<7> More oriented on the graphical side...
<9> skins?
<9> you'll be owner-drawing a lot
<7> with skin can we change the form of the window?
<8> Zirck: you'll have to either create a window with a WS_POPUP style and draw your own titelbar and handle moving/dragging or you can use WM_NCPAINT with an overlapped window to paint over the existing titlebar
<8> the former method is preferred
<8> with controls you'll have to subcl*** your child windows and handle WM_PAINT or use ownerdraw styles/functionality if any (for common controls, it's called custom-draw)
<8> if you're not a competent GDI programmer, it's not worth it
<10> i'm sure there are some cheap toolkits to do it
<10> i know the window themes libraries have available commercial dlls for doing it
<7> Toolkit for handle the basic structure and let only the graphical work...?
<7> I understand the basic way tequilla...Thanks for the info..
<7> I will search some inforation in that way..
<8> np
<11> yo teq
<12> morning tequilla dp2
<11> moin ct :)
<8> yo ceh, dp2
<11> what's goin on?
<8> not much, website design woes again :P
<8> trying to think of some way to design navigation for a layout like http://www.pastehere.com/?wwufxe
<8> et tu?
<9> hmm, it's all greek to me
<8> and here I thought it was latin :P
<11> that's cool. I'm kind of preparing to overhaul several systems, and I'm redrafting a network design for my application servers
<10> tequilla: how many tables are in there?
<11> yo pax :)
<10> hola dp2, how goes it?


Name:

Comments:

Please enter the result of the sum 63 + 46 (to avoid spam):






Return to #c++
or
Go to some related logs:

#allnitecafe
fingering women halal
#linux
#allnitecafe
#worldchat
what is xconntrack
#asp irc asp1serv
abla naber
#php
#india



Home  |  disclaimer  |  contact  |  submit quotes