Beginners - April 2015 (Page 44)

by davidm
continue not working
 
void countletters(char*s) { int cword=0; int size=strlen(s)+2; for(int i=0;i<=size;i++) { cword++; if((int)s ==32||(int)s ==0) { cout<<...
[18 replies] Last: saw it didn't like it too longgg... wat? I still didn't understand... (by Gamer2015)
Can someone explain what's the code is trying to do!
 
Please explain clearly! (: int a ; void inc(int val) { for (int i = 0; i < 10; i++) a += val; } int solve() { int pow = 1; for (int len = 1; len <= 1...
[no replies]
Making header with VS
 
Hello. I have some problems making header file with Visual Studio 2013. I do exactly the same steps from this ( https://msdn.microsoft.com/en-us/library/ms23562...
[7 replies] Last: Just did it with Code::Blocks using this: https://www.youtube.com/watc... (by mighty asker)
This program works, but not as i want.
 
I wanted to create a simple program that ask you simple yes/no questions. This is what i managed to get with my limited knowledge. #include <iostream> ...
[3 replies] Last: You can use char only and always check the length of string by strlen... (by shadder)
What's wrong ?
 
What is wrong at line 29 ? I can't see the problem :(. Half an year has passed since I worked the last time with C++, so it might be something really dumb. I k...
[7 replies] Last: Read around here see if any solution pops up - https://www.google.se/?... (by TarikNeaj)
program help
 
#include <stdio.h> /* copy input to output, replace each string of one or more blanks by a single blank */ int main() { int c, n1 = 0; ...
[12 replies] Last: Why do you use EOF here? EOF is for End of File, right? So it doesn't ... (by Gamer2015)
strcpy warning!
 
I have an assignment at school and every student is provided a code to run a program. I got trouble with the strcpy command. When I debug the program a warning ...
[7 replies] Last: To disable deprecation, use _CRT_SECURE_NO_WARNINGS (by ne555)
Objects in vector to variables
 
I have a Class with balance and interest that are objects in a vector. I want theese values in variables. How can I achieve this. This code below doesnt seems t...
[4 replies] Last: Solved it, now the interest is paid to evevry account in the vector. H... (by patriic48)
Will class member functions consume memory storage?
 
For example: class a { public: int v;//this one will need memory to store int method1();//how about these? int method2(); ...... ...
[2 replies] Last: thanks! (by northfly)
Under what condition will this pointer be invalidated? About a vector of class object which has vector members.
 
I have a class like this class a { public: std::vector<int> v; a * prev, * next;//this pointers gonna point to its neighbor } //now I use it like th...
[2 replies] Last: Thank you! (by northfly)
A pointer to base class cannot operate member object only exist in its derived class?
 
The following won't work #include <iostream> using namespace std; class base { public: int b; }; class derived:public base { public: int d; }; int main(...
[2 replies] Last: Thanks! (by northfly)
by Bocian
Help with program
 
Im trying to get a password verifier program working, i have made functions for it but, when i put in input it saves the first time but after it goes into check...
[5 replies] Last: Thanks a lot Terrison, i was working on it last night but i forgot to ... (by Bocian)
Memory fault for circular buffer
 
Hey guys I keep encountering a memory fault trying to call a class member function. Does anyone know why? Am I accessing something I shouldn't be? Thanks. ...
[4 replies] Last: Sorry for late reply but you were correct I hadn't allocated the memor... (by MOSKing)
Need help with my do while loop problem. :)
 
I have been experiencing difficulties finishing my function. To those who have time, please take a look. void prefix(){ int a; system("cls"); do{ c...
[6 replies] Last: Thank you very much!! Solved my problem. Have a great day man, thanks!... (by jam51197)
sort() function not working.
 
So I thought that the sort() function was included with the algorithm preprocessor directive (#include <algorithm>) but as I use sort, it doesn't work. Here's m...
[1 reply] : http://www.cplusplus.com/reference/algorithm/sort/ check out the proto... (by shadowCODE)
Explain for (int x:y)
 
Could someone please explain to me in detail how this works. for(int x : y). Basically the use of the colon, ':'.
[2 replies] Last: Search the web with "C++11 range-based for-loop". (by keskiverto)
by jmag91
Seeking help with my program!
 
I am writing a program that prompts a user to enter a sentence and then has a function that counts the letters in that sentence. For instance it will display h...
[16 replies] Last: And it's working!!!!!!! Thank you SO much for your help you guys. I ... (by jmag91)
Code rounding error
 
I have a school assignment that I am having a small issue with. Below is my code: // This program calculates the amount paid for stock, the amount paid on co...
[3 replies] Last: Whe you take a float (say 13.999) and then convert it into a int then ... (by shadder)
Array in function
 
Hi, I don't know why my value doesn't pass to the next function, can u please help me. Thank you, #include <iostream> #include <cstdarg> using nam...
[2 replies] Last: For anyone who might be interested in my program final result: Here's ... (by khatereh)
by slp99
Need help with a number diagram
 
I am having problems with diagram 2 and diagram 3. Can someone please help Diagram 1 12345 1234 ...
[1 reply] : Your spaces function is wrong, it should cout << ' '; and not cou... (by fg109)
April 2015 Pages: 1... 4243444546... 52
  Archived months: [mar2015] [may2015]

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