that was an excellent explanation mate
i totally understand now
thanks a lot mate :)
Type: Posts; User: mackol
that was an excellent explanation mate
i totally understand now
thanks a lot mate :)
actually when i added a cin.ignore () it did the job too ;)
after the second input it seems like the fail flag is set and it wont accept input the next time
here is the code.. really small and simple program
#include <iostream>
#include <conio.h>...
ignore question
i got it
cin.getline (f,100);
just in case anyone has the same question in the future. :)
stupid question
if i wanted to cin a string
but the string consisted of multiple words, how would i do it
for instance
i hear ya mates
thats exactly what i was thinking about and this other guy was having a debate with me about it
so just wanted to confirm
great example mate ;)
btw, that works as u mentioned...
??
for example
if u have a struct, TEMP which consisted of 3 members
1 int, 2 char pointers which were dynamically allocated (for strings)
and this structure is inside another node (for...
yeah the problem is kinda like that
it tells me
d:\Program Files\Microsoft Visual Studio .NET\Vc7\include\algorithm(1856): error C2064: term does not evaluate to a function
and then when...
input file for testing
www.mdofit.com/ide/27/lab9/input.txt
hi
my sort algorithm is having problems
its rather an unsual error
can anyone understand to solve the error
i am posting the entire code so that it can be tested
the error takes place in the...
sorry my friend
http://www.mdofit.com/ide/27/lab9/input.txt
let me post the most updated code now.
it works now
no error
no warning
but the problem is that after it creates 3 elements in...
*** update ***
now the code works but doesnt do exactly as it should. my vector jsut doesnt seem to exist properly.
any clues.
i give up. i cant seem to find the error in this code. i hate...
silly me
i have learnt it but never used it :D
cuz the teacher hasnt taught it yet ;)
but i dont mind using the string class just that i havent used string data types
what happens if i have a char array [20]
and i want to print only the first 3 letters of the string
what c++ function would i use?
the idea is that i have a ssn [10]
and i want to display it...
how would i use the ios::fail and ios::bad here
i mean how would they be set if the int contains a character?
my input is an int
not a char array
what happens if the user is asked to input a number or even comes from a file
and u wanna check if the input is really numbers and not something liek 124a
how would u check that
isdigit wont work...
thanks bros :)
is there a function to do that in C++
thanks :)
nah, i want to empty it completely cuz i am going through a loop to keep reading names from a file and i dont wanna use up space
so i wanna re use the char array
i was hoping that there might...
yup, i agree with that
oh thats right
memset, i forgot about it :D
well, is there a string related function?
how would i reset an char temp [30] array back to empty
for instance, after a loop it has some string stored in it. i want to clear it.
i could do it manually by going through a loop and setting...
i have just been in my first ever C++ class for 2 weeks now so we havent yet gotten to
in.getline (though i can see what it does)
i understand what the method getline would do
but i dont...