General C++ Programming - November 2011 (Page 43)

scanf_s into array help
 
Hello all, I am having a bit of trouble. Trying to read a text file with contents: "trigger for the bot to see" "alert for the bot to make for trigger" ...
[8 replies] Last: A char stores 1 character, not words. If you don't know how many li... (by ne555)
by jorgen
eof() changing behaviour?
 
I'm using ifstream to read data from a file, with eof() to see when I'm at the end of it (and in the example below writing double data to screen). I've been usi...
[2 replies] Last: And it works, thanks! (by jorgen)
by ivansl
need help!
 
as usual we could use "for" with "printf" like this : for (i=0 ; i<= 9 ; i++) { printf("%d\n", i); } can we use "for" with "fout" ,so we could create m...
[3 replies] Last: Look here: http://cplusplus.com/reference/clibrary/cstdio/sprintf/ Bu... (by Caligulaminus)
Calling C++ from VBA
 
Hello everyone, I would like to call a C++ function from VBA. I've been reading about DLLs and exporting C++ code but I don't understand how this works. I'm ...
[no replies]
by vitke
Recursion and function inlining
 
A simple recursive function that computes the factorial of an integer: int a (int depth) { return depth*a(depth-1); } void b () { std::cout <<...
[1 reply] : If you use the -S option to gcc, you can dump the assembly and have a ... (by kev82)
by Giri89
Pointer Queries
 
Hi All, With the below code, can anyone help me with the following? 1) Why the line I have commented besides does not appear the first time the progra...
[2 replies] Last: I think your problems stem from your use of strtod() . Let's take a ... (by kbw)
How can I create my own stringbuf?
 
Ok, so here is what I currently have: class CStringBuffer : public std::wstringbuf { public: CStringBuffer() : std::wstringbuf() { } virtual ~CSt...
[2 replies] Last: I ended up posting this as a bug in MS Connect: https://connect.micro... (by webJose)
by zurn
2 Random numbers
 
Hi I was wondering how I can generate 2 numbers, but not to generate random numbers with max num and min num? I want to "generate" between two numbers like ...
[3 replies] Last: @whitenite1 Thanks, I was doing that, but I thought there's less 'pri... (by zurn)
by ziczoe
HYE..
 
im new at this forum.. can anyone help me to solve this kind of prob.. it base on C++ sourcecode.. try to get the input.. Enter first name: Enter last na...
[2 replies] Last: #include <iostream> using namespace std; int main() { string name; ... (by Tatipu)
how to make cout like fprintf???
 
hello.. i really need help for my assignment. here it is the problem : usually we use fprintf to print a string in a file. which just like this : fprintf(file...
[5 replies] Last: that's how i laughed hwhwhwhwhwhwhw (by Lyncheese)
by orxshi
?extern? (1,2)
 
Hi all, Please take a look at the following: Header file: ... extern const int nFint; ... Cpp file (header file included in cpp file): const int nFint ...
[21 replies] Last: A reference is simply an abstracted pointer. Pointers can point to onl... (by ModShop)
Very URGENT : comma-delimeted lines
 
guyz, it's very urgent, and im starting to get bored from it; about the parsing matrix... When entering a new field i need three information : row, column, data...
[1 reply] : Check the reference section about "getline", which can take an optiona... (by moorecm)
by ziczoe
i need a help.. please3...
 
i have a question.. "if you push the letters W,X,Y, and Z IN ORDER onto a stack of characters and then pop them, in what order will they be deleted from the...
[3 replies] Last: ziczoe, what helios attempted, in a fairly verbose way, to inform you,... (by ciphermagi)
Basic pointer puzzle question
 
p1 == p2, as shown by the printout, which means the two pointers have the same address, but why the values are different after *p1=20? When two pointers point t...
[1 reply] : Nevermind, you answered my question. Now I'll answer yours. a is an... (by ciphermagi)
What is this for loop??
 
Can someone explain to me what this for loop is doing? for(ifstream fin("integers1.txt"); fin >> left[lpos++] >> right[rpos++]; ); lpos--; rpos--; Ste...
[5 replies] Last: Thank you steve. (by kraigballa)
by MoGuL
Dereferencing a const double* array, how?
 
Hi! I have a variable that is declared as "const double* value_of_interest", so that the data pointed to by value_of_interest (an adress) is a constant. Now I ...
[5 replies] Last: Thanks for pointing that out hamsterman, it solved my problem! What a ... (by MoGuL)
by Exiled
Supporting tile types larger than 9?
 
I'm creating a map editor for a game project. My method of mapping is having a large 2D array of chars(map ;). For different types of tiles, I simply set map ...
[6 replies] Last: Alright, I started storing the file as binary. Also, I have gotten til... (by Exiled)
c++ trouble, I cant figure the rest of the code out.
 
This is what I'm working on. I got some of the code but it don't seem to work right. I dont know how to sort the array out to subtract the highest and lowest nu...
[2 replies] Last: Pointers are random access iterators. http://cplusplus.com/reference/s... (by ne555)
by gwiz
Buffer overflows
 
Hey, someone just introduced me to buffer overflows and how they can be doorways to malicious attack. Does anyone know anything good to read on how to prevent t...
[2 replies] Last: You could use STL types if you can instead of C types ( string instea... (by eypros)
Initializing structures
 
I was just wondering if there is a way to initialize a structure but instead have it place a pointer in an array like so: struct A { int a; A* b; }; A ...
[4 replies] Last: Yah that works, but I want to do it without having to give a name to e... (by closed account o1vk4iN6)
November 2011 Pages: 1... 4142434445... 47
  Archived months: [oct2011] [dec2011]

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