[Solved] Why is this code not taking input for “Designation”?

When reading from standard input, do not mix C library functions, such as fgets(), and C++ std::cin operators. The C library knows nothing about what the C++ library is doing. Change your code to use only stdin, or only std::cin, to read standard input. solved Why is this code not taking input for “Designation”?

[Solved] How to process a string? [closed]

Declare a variable to count the stars with an appropriate data type. Iterate (loop) over the string to check each character for equality with ‘*’. If this is the case then increment your star counter. Width and height are not required. If you want to constrain a larger field to the width and height provided, … Read more

[Solved] Split a string C#

You can use Regex.Matches(): string source = “Mobile: +49 (123) 45678Telephone: +49 (234) 567890Fax: +49 (345) 34234234”; string[] phones = Regex .Matches(source, “[A-Za-z]+: \\+([0-9)( ])+”) .Cast<Match>() .Select(i => i.ToString()) .ToArray(); OR You can use IndexOf(): string source = “Mobile: +49 (123) 45678Telephone: +49 (234) 567890Fax: +49 (345) 34234234”; var telephoneIndex = source.IndexOf(“Telephone”, StringComparison.InvariantCulture); var faxIndex … Read more

[Solved] Who can help me with a key list in C?

If i understood it right, you want to achieve the requirements by using the program you wrote above. It possible to re-design it using your own code. eg : For get() struct node *get(int key, void *data) { if(*head_ref != NULL) { key = *head_ref->data; return *head_ref; } else { printf(“Error in retrieving data from … Read more

[Solved] Format DateTime without converting it to a string in c#? [closed]

I think there is a bit of a confusion here what the string concatenation does to your values. It is nothing less than simply using the default format for a parameterless ToString()! Each of your strings like Debug.Log(“currentTime: ” + currentTime); basically internally implicitly equal Debug.Log(“currentTime: ” + currentTime.ToString()); In that case the ToString() without … Read more

[Solved] Calling method inside a method in Interface c#

When you create a method which is named InternfaceName.MethodName it is called Explicit interface implementation. What it means is that that method is accessible only through a reference of the interface type. So… How can you call to that method from within the class? Cast this to the interface type! public void MyBalance() { Console.WriteLine(” … Read more

[Solved] Convert dec to hex number in C [duplicate]

You’re asking about the wrong language. C does not support the dot operator on integers. To do this in C, you need to print it to a string like so. char numstr[10]; sprintf(numstr, “%X”, 255) 3 solved Convert dec to hex number in C [duplicate]

[Solved] Why this code work?

The C++ compiler can’t and won’t catch all the possible way you could write incorrect code. And while running, a C++ program will usually not throw an error the moment you access memory out of bounds. The language was not designed to protect the programmer from doing bad things. So when a program does something … Read more