Troubleshooting C++ Program: Understanding usrStr and userInput Functions

  • C/C++
  • Thread starter elmessican
  • Start date
  • Tags
    C++ Program
In summary, C++ is a high-level programming language used for developing software applications, games, and operating systems. It can be challenging to learn and seeking help from online resources or tutors can greatly improve understanding and skills. Resources for help include online forums, tutorials, and universities. To improve C++ programming skills, it is important to practice, use online resources, and study code written by experienced programmers. Common mistakes to avoid in C++ programming include not properly declaring variables, using improper syntax, and not regularly testing and debugging code.
  • #1
elmessican
6
0
I'm having trouble understanding how to use the "usrStr" or how to use the userInput in both of my functions. I know the problem with my code, i see that when i call the OutputWithoutWhiteSpace(userInput) function it works fine but it adds the extra characters

first sentence = 46 characters
then when i call the withoutspaces fuction it adds the whitespaces eliminated to the result
 
Technology news on Phys.org
  • #2
Hi, and welcome to the forum!

Could you post the code you are talking about? Please wrap it in the [CODE]...[/CODE] tags.
 

FAQ: Troubleshooting C++ Program: Understanding usrStr and userInput Functions

1. What is C++?

C++ is a high-level, general-purpose programming language that was developed by Bjarne Stroustrup in 1983. It is an extension of the C programming language and is widely used for developing software applications, games, and operating systems.

2. Why do I need help with my C++ program?

C++ can be a challenging language to learn and master, especially for beginners. It requires a strong understanding of programming concepts and syntax, and even experienced programmers may face difficulties in solving complex problems. Seeking help from others, whether it be through online resources or a tutor, can greatly improve your understanding and skills in C++.

3. Where can I find help with my C++ program?

There are many resources available for getting help with your C++ program. Online forums and communities, such as Stack Overflow, are a great place to ask specific questions and get help from experienced programmers. You can also find tutorials, documentation, and other helpful resources on the official C++ website. Additionally, many universities and colleges offer tutoring services for students learning C++.

4. How can I improve my C++ programming skills?

Practice is key when it comes to improving your C++ programming skills. Set aside time to work on coding challenges and projects, and make use of online resources to learn new techniques and concepts. It can also be helpful to study and analyze code written by experienced programmers to gain a better understanding of how to write efficient and effective code.

5. Are there any common mistakes to avoid in C++ programming?

Yes, there are some common mistakes that beginners make when learning C++. These include not properly declaring variables, not using brackets in control structures, and not using proper syntax for functions. It is also important to avoid using depreciated or outdated functions and to always use proper indentation and naming conventions. Additionally, make sure to regularly test and debug your code to catch any errors before they become bigger issues.

Similar threads

Replies
14
Views
32K
Replies
1
Views
4K
Replies
2
Views
5K
Replies
2
Views
2K
Replies
0
Views
1K
Replies
8
Views
2K
Replies
40
Views
3K
Back
Top