Beginners - October 2017 (Page 28)

C2181 illegal else without matching if
 
#define _CRT_SECURE_NO_WARNINGS #include <stdio.h> int main(void) { float Grade; char A; char B; char C; char D; char F; puts("Enter a student...
[4 replies] Last: thank you all for your help (by iceman870)
time complexity
 
im trying to make a chart i cant figure out time complexity and my average complexity of my code is O(n^2logn) i dont get how to get the time conmplexity
[no replies]
Hey guys I am extremely new so i need a help with my For Loop code
 
So im trying to add the previous number to the next one like 1+2+3+4+5...+n, when i put int a = 0; in the For loop it doesnt add it just displays like if i wri...
[6 replies] Last: Hello dolma123, I put together these two versions of your original pr... (by Handy Andy)
String as a name of an object.
 
Hello Is there any way to implement this in C++ ? Or is there any alternatives to do this? I mean using a string as a name of an object. #include <st...
[7 replies] Last: Well, theoretically you could do the following (but I can't for the li... (by lastchance)
by Cozza
Trouble printing string member variable.
 
Currently when the attempt to print creature01.name is made, the console is blank, so it seems that the string is just not printing. It works when I use int mem...
[1 reply] : Line 10 should be name = nam; Line 14 should be int main() ... (by lastchance)
two questions in one
 
Hi guys so the first question is I found eclipse made two.exes from one program I get SDLTest and SDLTest(1) I have to select SDLTest for the actualy program to...
[3 replies] Last: The program "freezes" for 9 seconds because you call SDL_Delay(9000). (by Peter87)
by SasuKe
Linked List
 
I'm doing my Final Exam revision and I'm stuck. Here's the question. Question 3 (15 marks) Use the following declaration for singly ...
[1 reply] : Right at the start of the insertNode function, you throw away the va... (by MikeyBoy)
alt+ 0176
 
when i use getch() ,i can not input alt+0176 and stuff like that.But i can do it with cin>>something...i do believe facebook or any game still accept alt+0176 (...
[5 replies] Last: So my guess was close, but not quite right (I assumed Visual Studio, w... (by Cubbi)
average case complexity
 
i have a question about average case complexity, if you have a for loop for (int i = 0; i < n; i++) // would this still be O(n)
[3 replies] Last: Tangentially, and mostly just because I like to repeat it when order n... (by Repeater)
expected initializer before 'speak'
 
hi guys this error in eclipse is baffling me,I have researched why this might be happening to me and can't see anything wrong with code yet I am getting this er...
[4 replies] Last: Also adds to why "using namespace ___;" declarations are almost alway... (by keskiverto)
Help me fix
 
It shows error when I try to compile it please help #include <stdio.h> const char"a, b, c, d, q" int main() { char char1; const char ("a, b, c, d, ...
[3 replies] Last: Assuming that this is C: a case label can't be a variable. 'a', 'b' e... (by JLBorges)
Pointers and arrays
 
This is the following code #include <iostream> using namespace std; int main() { long n = {100, 200, 300}; long* ref = n; n ++; cout << n << " " << *ref <...
[5 replies] Last: @muffin123, n was increased from 201 to 202 on line 14, because ref ... (by lastchance)
inheriting constuctors
 
Hi guys I'm watching John Purcells videos on c++, he says that constuctors are not inherited by the sub class of a super class but the super class's const...
[1 reply] : The language used in that description is a little murky there... The ... (by Duthomhas)
SDL no such file problem
 
Hi guys I am trying to get SDL working,but with no success I followed this guide https://www.caveofprogramming.com/c-for-complete-beginners/setting-up-sdl-wi...
[no replies]
Array's minimum value returning as 0.
 
I am writing a code that uses functions to determine the minimum and maximum values in an array. The maximum function works fine, but the minimum keeps returni...
[6 replies] Last: Thank you for all of your insight. (by al bama cpp)
Dynamic Array vs Array Benefits
 
After looking into dynamic arrays I found this on cplusplus http://www.cplusplus.com/forum/beginner/7961/#msg36866 So if someone can please clarify to me the a...
[4 replies] Last: Sure, that's perfectly legal. You can always allocate more space than ... (by Ganado)
Reverse the order of a series of words
 
Hello! I'm trying to learn pointers and I have this exercise that I'm having trouble with. I'm trying to reverse the order of a series of words using a pointer ...
[1 reply] : Hello ivar5000, My rearrangement of your program. Read the comments i... (by Handy Andy)
by Nico
Loosing memory, where does it go?
 
Hello, I have made a class to send UDP-messages to a specific ip-address and port. Every time I have send a message I should receive a message back. This wo...
[1 reply] : I don't know if it has anything to do with the issue you describe but ... (by Peter87)
by RNBW
Printing output to a text file
 
After spending time trying to find out how to direct output to a printer (I use a wireless printer) without success, I decided to look at printing to a text fil...
[4 replies] Last: Most IDEs don't do much configuration of the compiler by default, so y... (by jlb)
array has no values?
 
hey guys, I declared a function that returns a pointer to an array,but when I try to print the values out in main all the values seem to be null or blank ...
[3 replies] Last: that makes sense thanks guys (by adam2016)
October 2017 Pages: 1... 2627282930... 33
  Archived months: [sep2017] [nov2017]

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