Beginners - November 2010 (Page 13)

by SeBeQ
Problem with EOF
 
Hi! I want read my file by this: while(!feof(f)){ fread(&buf, sizeof(buf), 1, f); value = buf.id; ............... } //buf is struct Problem ...
[3 replies] Last: You want to be careful with the fread () and feof () response. Just ... (by Duthomhas)
Restart program?
 
i was wondering if there is a certain code to restart the program resetting all variables and such so like say if i do int returnto; cout << "enter 1 to ...
[3 replies] Last: No. You must always initialize your variables properly. Good luck! (by Duthomhas)
Error reading file, maybe EOF problem
 
I am writing a small search engine program. The simplest and least important portion of my code has a bug I cannot fix. The code reads words from a text file...
[no replies]
Recursion problem
 
Hiya. So I'm supposed to make one of those star diamonds like this: * ** *** **** ***** **** *** ** * but a little different using recursive functi...
[9 replies] Last: Wow! That is epic, lol! :D I didn't notice it no, but it's pretty coo... (by Anders4000)
change to interaction
 
-----------------------------------------------
[2 replies] Last: okays, nevermind. i've found the solution. thanks :) by creating an... (by nanochan1)
Adding elements to a pointer array
 
I'm trying to add elements onto an 'array', without using vectors. And I was wondering if this sort of thing is possible: void data::add(int newNum) { ...
[3 replies] Last: Nevermind, I got it! Thanks! (by jamesmk)
by lazza
problem on string to integer
 
Hello everybody, i am new here. I need a help to check my code. i did below problem. Your task is to write a program which reads two integers (more than or ...
[1 reply] : for (int i=1;i<82;i++){ int k=0; if (arrnum3[i-1]>9){ ... (by hamsterman)
by KDeuce
use of classes
 
I am generating a hotel program and iam doing it in steps.....very new to c++ this is what i have so far; my problem is when i call the function Get_Rate it g...
[8 replies] Last: If you want to learn C++.see all... http://www.cplusplus.com/doc/tu... (by firix)
compilation problem
 
I created these three files and put them in the same folder. I am using Ubuntu. I tried to compile this with both gcc and g++ commands.. but i am getting errors...
[2 replies] Last: oooh... stupid me... thanks Null... thank you very much... hehe.... i ... (by chathura666)
Hangman - Game doesn't end even when all blanks are full
 
I'm writing this Hangman game and this is the function that i'm using to tell if the game is over: //blanks is the array of blank spaces i.e. _ _ _ a _ _ ...
[4 replies] Last: Don't use goto. You got a logic problem. http://en.wikipedia.org/wiki... (by ne555)
c++ equivalent of in_array
 
I'm trying to remake that function as it works in php. I need it to search for a char type from an array of char types. Here's what I have: char array = {"...
[1 reply] : Using std::string instead of C-style strings would drastically simplif... (by jsmith)
Bubble Sorting algorithm
 
Hi Hi Hi There ! After I have studied iterators long enough, I decided to try and see how a bubble sort would work if done completely with them, however my c...
[2 replies] Last: Hello Brown3141, Thank you for your reply. It seems it was easy fo... (by joseplusplus)
Instantiation with Derived Classes
 
I am developing my own project for the practice. I am having a great deal of difficulty conceptualizing the classes I want. The scenario is that of 2 countrie...
[11 replies] Last: I had read that tutorial a 3 months ago but re-read it this morning. ... (by nathan10)
by SeBeQ
I can't copy the contents of an array to another array in struct
 
Hi I have struct struct sFile{ WCHAR filename WCHAR path }; I get file and path with OPENFILENAME and GetOpenFileName(&ofn) I have buffers varia...
[no replies]
Bool function loop
 
bool isInt (int& a) { try { if (!(cin >> a)) { throw a; return true; } } catch(int r) { cout << "Invalid numeric number"...
[1 reply] : First, awful use of exceptions. If you are going to handle the error j... (by ne555)
by Eyecon
Hangman program
 
I am trying to make a hangman program to practice i made the following and it runs without errors but it doesnt what its supposed to do i get some weird text in...
[4 replies] Last: Running… hello Untitled(6281) malloc: *** error for object 0x10... (by Eyecon)
by Adidas
How do I know how many files passed to cmd?
 
I need help. I know the functions argv , argc but how can I know how many parameters passed to the cmd ? if I have for example 3 txt files then my argc need...
[3 replies] Last: http://www.israup.net/images/2b61b8c037498389c5a9eb8e0f015188.png h... (by Adidas)
Recursion! Don't understand :(
 
So there is this code I found that does exactly what I need but I don't understand it: /* function to swap array elements */ void swap (int v , int i, in...
[15 replies] Last: Well I understand the basic concepts of it so am going to leave the co... (by Bman900)
What's wrong with what I'm typing please?
 
Please tell me if there's anything wrong with the following please. I'm a beginner. I've only been doing this for a few days, and I'm just starting to get the k...
[4 replies] Last: Thank you. That worked perfectly. I wonder why it did not say that in ... (by Pennywise321)
Initializing Arrays
 
I have a few quick questions related to arrays. I have two files below. arithmetic.cpp will eventually become a header containing functions for base two calcula...
[7 replies] Last: That 192 got there by magic. You are lucky your program didn't just c... (by Browni3141)
November 2010 Pages: 1... 1112131415... 42
  Archived months: [oct2010] [dec2010]

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