Search:
Type: Posts; User: codingnewbie
Search:
Search took 0.03 seconds.
-
October 28th, 2010, 01:53 AM
-
October 26th, 2010, 02:14 AM
1. Should I name an unchanging variable received as input from the user when starting a program with all CAPS like a constant?
2. When declaring variables at the start of a function, is there any...
-
September 27th, 2010, 05:58 AM
I have a directory with a .htaccess file within it, and a folder in the same directory containg thumbnail images. The actual page where the thumbnails are displayed is above these directories and...
-
September 22nd, 2010, 07:54 AM
Thanks for the info. I was just trying to make a program that produced a wav file with a simple sine wave and needed specific sizes for the header and audio data. It was just a test and it worked...
-
September 20th, 2010, 03:48 AM
I need a two byte integer and a four byte integer. I could use a short and an int, but how I would specify such integers so as to guarantee their length?
-
September 18th, 2010, 11:15 PM
Ok the problem was that I forgot that with the range specifier you need to have enough room for a terminating null byte as well, so that was overwriting the first byte of the next declaration with a...
-
September 18th, 2010, 05:57 AM
Thanks, I ended up making my own simple scan function though, which stores either characters, or digits converted to integers, in a supplied void pointer array, along with the last character taken...
-
September 17th, 2010, 09:46 PM
This is the scanf line: res = scanf("%1[yn]", &chr); Is there anything wrong there?
-
September 17th, 2010, 08:05 AM
I had a char "chr" and a char array "filename" declared on the same line "char chr, filename[256];", and i was getting a weird segmentation fault when i tried to free an array of char pointers for...
-
September 17th, 2010, 07:49 AM
thanks for the suggestions, i'll give them a try
-
September 16th, 2010, 12:33 AM
I am using gnu deugger and want to have it continuously display the local vars. I can use `info locals` to display them once, but I'm not sure how to keep them displayed. It is tedious using `disp` ...
-
September 16th, 2010, 12:27 AM
-
September 15th, 2010, 03:03 AM
i need to determine whether stdin is empty when scanf fails, because if it isn't I want to get a character from it with getc. If I use getc when it is empty though it will prompt the user for input...
-
September 12th, 2010, 08:11 PM
Thanks for all the replies. I do realize it wont make it any faster, but I actually find it easier to read this way due to it being only one line rather than two, adding another level of indentation.
-
September 12th, 2010, 06:12 AM
I have an expression in C: if (aaa = bbb && (ccc = getc(stdin)) != ddd), and I need the first expression to be evaluated first. Does C, and for that matter other programming languages, always...
-
-
This works:
fProfList.open("profList.txt", ios::in);
This doesn't:
fProfList.open(temp, ios::in);
error = 91 C:\Dev-Cpp\programs\fiotest2.cpp no matching function for call to...
-
-
I have another problem. How do I write the vector back to the file with a new line after each element EXCEPT the last? At the moment with this:
for (ref = container.begin(); ref != container.end();...
-
Oh I see, I have to use an iterator to delete the whole element. Silly me!
-
Thanks, I forgot about that mode! I have one more question though. When I use erase() on the vector it only seems to delete the text and not actually get rid of the element. How do I get rid of the...
-
Thanks, but could you be a bit more specific. Here is my current code:
#include<fstream>
#include<iostream>
#include<string>
#include<vector>
using namespace std;
-
I want to read the text of a file to a vector, then add or delete some stuff and then save the vector back to the file, but I'm not exactly sure how to do it. For example if I just write the modified...
-
-
Cheers, that works well :). What does the clear() function do though when used with i/o though and why do i need to use it?
|
Click Here to Expand Forum to Full Width
|