Please note, this is a STATIC archive of website www.tutorialspoint.com from 11 May 2019, cach3.com does not collect or store any user information, there is no "phishing" involved.
Tutorialspoint
Cover Image
Cover Image
Drag to reposition
Contributed Answers

Why we can't use arrow operator in gets and puts?

, With dot operator it's ok to use gets. e.g gets(s.name); but not with arrow operator please reply as soon as possible.
Answered on 8th May, 2018, 0 Views

You can't read user input in an un-initialized pointer. Instead, have a variable of the struct data type and assign its address to pointer before accessing its inner elements by -> operator , ,

Extract decimal numbers from a string in Python

How to extract decimal numbers from a string in python and can u explain this in detail and i need a code for this??
Answered on 8th May, 2018, 0 Views

Using RegEx module is the fastest way. , Assuming that the string contains integer and floating point numbers as well as below: >>> s='my age is 25. I have 55.50 percent marks and 9764135408 is my number' the findall() function returns a list of numbers matching given pattern which includes digit before and after decimal point , Result is a list object of all numbers ,

How to convert a string to a integer in C

Hello, guys, i am having so difficulties with a problem. Each string has a name of a film followed by a date that corresponds to the release date of the movie The aim is to create an array of strings of movies that are prior to a certain date.. For example , And the objective is to put in a array of strings all movies prior to 2008 How can i do it? I was thinking using atoi but i don't .....
Answered on 8th May, 2018, 0 Views

First extract characters from left bracket '(' using strchr() function. , Then add each character within brackets () to an char array , Lastly convert resultant string to integer using atoi() function , You can now apply required filters ti create array of strings of all movies prior to 2008

C++ 'a.out' not recognised as a command

Hi all,  I'm new hear and very new to coding. Just setting out on my learning journey to be honest. I'm hoping someone will be able to help.  I've set up my C++ environment and was about to start learning and practicing, following the Tutorials Point tutorial.  I created my first helloworld.cpp file, used g++ to convert it to an executable file and then followed the tutorials.....
Answered on 8th May, 2018, 0 Views

Having entered following command from linux terminal , The a.out file should be created in the current working directory if the compilation is successful. Check if a.out is created. To execute enter following from command line , In most cases, output of your source program is displayed. However, as in your case, error message indicating a.out is not executable is appearing. See the properti.....

compareTo() definition mistake?

https://www.tutorialspoint.com/java/lang/string_compareto.htm Example code of compareTo does not allign with the definition. Or am I wrong? ,
Answered on 1st May, 2018, 0 Views

The example works correctly. The compareTo() method is called by a string object and takes another string object as argument. The return value is integer and is difference in Unicode values of characters of respective strings when they are not equal. The value can be -ve, 0 or +ve.

How to write string functions in Java?

How to write following string functions using Java? 1) take a string from the user and check contains atleast one digit or not? 2.) take a string from the user and check contains atleast one alphabets or not?  3). take a string from the user and check contains atleast one chars or not?
Answered on 1st May, 2018, 0 Views

1) take a string from the user and check contains atleast one digit or not: Extract character array from string using toCharArray() method. Run a for loop over each character in array and test if it is a digit by static method isDigit() of character class , 2.) take a string from the user and check contains atleast one alphabets or not Similarly isLetter() method of character class is used .....

Java is also not pure object-oriented like c++

If we can make a program without making an object using the static keyword with void main so we can say java is an object-oriented programming language. 
Answered on 1st May, 2018, 0 Views

the main() method in Java code is itself inside a class. The static keyword lets the main() method which is the entry point of execution without making an object but you need to write a class. In C++, main() is outside the class and writing class it self is not mandatory. Hence, C++ is not a pure object oriented language bu Java is a completely object oriented language.

Python - How to convert this while loop to for loop?

, ................................................................................................................... (( the question is : how can i convert this by using "for loop" instead of "while loop")) + (( I want the same result for both )). please help me ..
Answered on 1st May, 2018, 0 Views

Usin count() function in itertools module gives an iterator of evenly spaced values. The function takes two parameters. start is by default 0 and step is by default 1. Using defaults will generate infinite iterator. Use break to terminate loop. , Sample output of the above script ,

How can I convert a Python Named tuple to a dictionary?

How can I convert a Python Named tuple to a dictionary?                                           
Answered on 3rd Mar, 2018, 0 Views

Namedtuple class is defined in collections module. It returns a new tuple subclass. The new subclass is used to create tuple-like objects that have fields accessible by attribute lookup as well as being indexable and iterable. The constructor takes type name and field list as arguments. For example, a student namedtuple is declared as follows: , Object of this namedtuple class is declared a.....

How to split Python tuples into sub-tuples?

How to split Python tuples into sub-tuples?                                     
Answered on 3rd Mar, 2018, 0 Views

Here is a tuple with 12 integers. In order to split it in four sub-tuple of three elements each, slice a tuple of three successive elements from it and append the segment in a lis. The result will be a list of 4 tuples each with 3 numbers. ,

1 2 3 4 5 6 7 8 Next
loader
Advertisements
Contribution

We use cookies to provide and improve our services. By using our site, you consent to our Cookies Policy.