Beginners - March 2014 (Page 62)

Two For Loops Holding Values
 
I want the second for loop to hold its value and not reset every time I break out. Is there a way to do this using static variables? Just curious, thanks. ...
[1 reply] : just a suggestion, u declare y outside the 2 loop, but remember to giv... (by selenium)
how to stop a void function
 
how to stop a void function ??? i remember that using return; can stop the void function. however, at the end of the following function, it prints win ...
[4 replies] Last: return 0 to stop the void function :) (by smartmind)
by enemy
invalid conversion int to int*, 53 line
 
Hello! Please, does someone see what is wrong here? #include<iostream> using namespace std; int* f2(int z){ int* str=new int ; int s=-1; sran...
[8 replies] Last: Hello! U just opened another question I wanted to ask!!! This is the ... (by enemy)
by chofs
vowel & consonant counting
 
okay am writing a code that reads the number of vowels and consonant...code is running only for counting vowels n not consonants....made separate loops for each...
[4 replies] Last: okay i also took into consideration space chacters as you said cire...... (by chofs)
I am C++ illiterate.
 
All im trying to do is make the for loop break when the nth element of array c is a space ' '. Any help would be appreciated #include <iostream> #include...
[2 replies] Last: Yep sorry i went full retard im just going to use that as a condition ... (by nickmiller24)
help...problem
 
i wrote a code, but the output shows very large numbers, and i do not know how to fix it..plz help me.. #include<iostream> #include<iomanip> using namespace s...
[7 replies] Last: thx it works..:) (by passw0rd)
Binary Search issues
 
Hello everyone, I am trying to write a program that uses a binary search to find the position in the array of the element the user picks. I am having two proble...
[8 replies] Last: Thanks guys. Learning C++ is going to be a slow and painful process. (by Mechennyy)
lights
 
can any one give me a code for begin able to press a button to turn light on there are 4 button and 4 lights thank you
[1 reply] : bool pressed = true; if(pressed) { //turn light 1 on } In al... (by giblit)
Airplane Seats
 
Hey there people, back again, below is what my project is supposed to be. The errors I am getting are in line 54 and 178. Line 54: Expected '(' for function-...
[7 replies] Last: Well line 31 is a pretty straight forward error. You have columns as a... (by giblit)
Linear Search
 
Hello my problem with this code is that instead of showing "element not found" it show n+1th position which is element out of array Please help where am i...
[3 replies] Last: @kbw Thanks really really thanks Yes I overlooked this small mistake a... (by closed account 4jzvC542)
by kimi86
Vector of structs
 
I have written the following code to sort a vector of structs Out put of below code is like this: RANK: 7----papu RANK: 7----hen RANK: 8----pavi RANK: ...
[1 reply] : #include <string> #include <iostream> #include <vector> #include <alg... (by JLBorges)
Help me please
 
Please help me, I try to write a program that includes a user-defined function named dayOfWeek that will take a date as three separate integer arguments represe...
[no replies]
by giblit
Regex problem
 
I am playing around with regex but it seems like my pattern is not working. std::regex regex("^-?(0|[1-9]\\d*)[+\\-*/]-?(0|[1-9]\\d*)$") What I was trying...
[4 replies] Last: Oh alright cool thanks. I'll have to mess around with boost. I just wa... (by giblit)
I finally did my homework but..
 
Write your question here. I made a function for c++ and my professor said I cannot use sqrt(n) in my function. I have no clue how to make this function without...
[8 replies] Last: @giblit I wanted to do it by myself if I know how to do it. All of my ... (by qwertyking)
by nefi
Confused to while my overloaded operator won't pass values from new object
 
Thank you for taking your time and reading this, it's my first time posting so please if I asked incorrectly, let me know so I can correct my mistakes. My qu...
[9 replies] Last: @keskiverto Goodness man! You did exactly what I wanted, you kicked m... (by nefi)
Please Help me
 
Please help me, I try to write a program that includes a user-defined function named dayOfWeek that will take a date as three separate integer arguments represe...
[no replies]
Choosing Array based on a trigger/if/variable
 
Is it possible to have it pick what array to use based on a variable or trigger? Something like: string array If (input.length() == 3) { array = PT2 /...
[5 replies] Last: Well it all depends on what you are trying to accomplish. You could t... (by giblit)
Do functions confuse you?
 
When making my functions, they always confuse me except when it's a void menu () function. I get really confused when making it so i end up putting everythi...
[6 replies] Last: That's the thing. I know what they should do when thinking about it bu... (by closed account iAk3T05o)
code is not compiling!! urgent
 
Write your question here. I'm using visual studio 2012, and the code seemed to be right but it's not compiling. anyone find the problem with this code?? ...
[6 replies] Last: qwerty you are missing the '[' in your code tags that is why yours is... (by giblit)
stdio.h to iostream?
 
Write your question here. So i was doing the homework for my class, and I was stuck as always and asked my friend to help me with it. he wrote the code correct...
[9 replies] Last: Thank you everyone I finally changed everything because of your help ... (by qwertyking)
March 2014 Pages: 1... 6061626364... 79
  Archived months: [feb2014] [apr2014]

This is an archived page. To post a new message, go to the current page.