Beginners - July 2017 (Page 8)

Array help
 
thank you.
[6 replies] Last: MikeyBoy. sorry. I won't do it again. I forgot what I wrote in the ori... (by piratekingluffy)
Why does my array seem to double in size the second time I write it to a file?
 
Hello, Why does my array seem to double in size after writing to the file a second time in the following code: #include <iostream> #include <fstream> ...
[4 replies] Last: For me the program prints 40 four times. 40 40 40 40 (by Peter87)
is Gui library the same as Graphic library ?
 
well I am wondering if it is the same because awt and swing are both gui library but it can be used as graphic library
[3 replies] Last: wait...but swing and awt is a gui library...yet they can be used as gr... (by Flaze07)
Pass by reference (&)
 
Can someone explain/give me an example of how the & symbol is used in C++. I looked at a couple of tutorials and read up on it but still dont understand. Thanks...
[2 replies] Last: #include <iostream> void modifyMe(int &value) { value = 42; } v... (by Smac89)
Does closing a stream also reset the position of the stream in the file?
 
Hello, I would like to know if closing a stream also results in the resetting of the position of the stream in the particular file. In other words, if I clos...
[2 replies] Last: Okay, thank you! (by stephanos)
C++ functions
 
A program contains the following function. int cube(int num) { return num * num * num; } Write a statement that passes the value 4 to this function and assi...
[3 replies] Last: To nit-pick, though there is nothing wrong with the code above, the OP... (by Chervil)
why does this happen with const pointer to int?
 
I wrote the following two codes. but one is giving erro #include <iostream> using namespace std; int main() { int var1=10; int *const ptr; p...
[3 replies] Last: can you tell me where can anybody use this int * const?? Any time y... (by AbstractionAnon)
C++ Error: SDL_JoyStick has not been declared
 
I am using SDL 2 and I am trying to write a void function that accepts an argument of SDL_Joystick. However, I am getting a compiler error saying that the varia...
[1 reply] : You need to spell SDL_Joy s tick with a lowercase s. (by Peter87)
by ebii
reading integer from file
 
how can i put all integers that i read from files into array seems i have a bit trouble here it alwys print the last integer value int main() { fstrea...
[4 replies] Last: thanks alot man helpd alot (by ebii)
Pointer of object within object itself
 
Is it possible to store to pointer of an object within the object itself? struct vertex{ const vertex * vrt_ptr; } I'm not entirely sure this is va...
[10 replies] Last: Usually the address-of a particular object is written using the built-... (by mbozzi)
Trouble with some Loop Examples
 
I have some questions in regards to the loop examples, and it's two of them. The first one is using accumulator in while loops, and I wrote down my question in ...
[11 replies] Last: Cool, got it. Thanks for the help! :) Will mark as resolved. (by Bayan Khorshidi Berkeley)
Reading from a binary file I've just written to
 
Hello, I've just begun learning about binary files, and I'm having trouble reading what I've just written (at least tried to write) to the file "this.bin". ...
[6 replies] Last: Thank you for the explanation and all of your help! (by stephanos)
Assignment clarification
 
So I'm working on an assignment for my Intro to C++ and as a disclaimer, I'm asking that you do not post your code or script of the solution, as I would like to...
[5 replies] Last: Thanks again guys. Should be easy enough :) (by portpabs)
Win sock
 
Hello everyone, I have a question. If I was to make a server in c++. Would it be a good idea to use winsock2.h header file for comunication with the clients ...
[2 replies] Last: I am not sure if visual studio specifically wants you to use a differe... (by jonnin)
How can I choose where in a file I write?
 
Hello, I would like to write to a file using fstream, but I would like to know how I can write to a specific location. Say I draw out a 10x10 matrix in my fi...
[3 replies] Last: Jonnin is correct; however, I'd like to ask you what are you trying to... (by koothkeeper)
Tic Tac Toe Program
 
This is a tic tac toe program that has computer to act like a player 2 and it needs to have srand and rand with %. But, I can't seem to be able to do it. So ple...
[5 replies] Last: @dheydan THnak you so much for your help! I would never have beeen abl... (by suna6382)
smart menu (1,2,3)
 
Hello ! I have made a smart menu that does the following: 1) allows to add a function with a name tied to it. 2) allows deleting an option by name. 3) set menu...
[54 replies] Last: Well in theory it does but the function is a member function and it is... (by globaltourist)
Setters and Getters in C++
 
I still can't seem to grasp the whole setters and getters in C++ This is the assignment: In this file, you declare a class named MyString. – This class ...
[8 replies] Last: ah.. rather than char* str it is better to have char* str a... (by Flaze07)
by ebii
compiler jumping
 
when i run this code. output going bit crazy output: enter name: aa eneter account :111 enetner name enter account not letting me entrance a name and alr...
[3 replies] Last: guys youre awsome thank you very much for your kind help . (by ebii)
by Kuluoz
Change CAPS/SMALL in buffer data
 
Hi friendz, Que 1: I was read buffer.and i was check string using strncmp. Is any possible to change all data is CAPS/SMALL in buffer data? Unsigned cha...
[7 replies] Last: @kuluoz Your testing code doesn't really make sense - I put indices o... (by lastchance)
July 2017 Pages: 1... 678910... 12
  Archived months: [jun2017] [aug2017]

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