In fact my program is ok.
The problem was the text file that was large but with only 5 or 6 \n characters. (I can't express it in another way- it is when you press enter when you write the text...
Type: Posts; User: skiabox
In fact my program is ok.
The problem was the text file that was large but with only 5 or 6 \n characters. (I can't express it in another way- it is when you press enter when you write the text...
ok I managed to read the file in the debugger console, but I don't get the 24 lines pause.
Any ideas?
Here is the code :
#include <iostream>
#include <fstream>
#include <string>
using namespace std;
int main (int argc, char * const argv[]) {
const worked, but what if you want to change an item?
I am using xcode 3.2.5 and I am reading C++ Without Fear.
At the chapter five there is this code from the author :
#include <iostream>
#include <stdlib.h>
#include <time.h>
#include...
I suppose that we can omit x or y if one of the two is zero.
See this code that I get from a book I am reading :
for (i = 0; i < 9; i++)
if (planets[i][0] == 'M')
printf("%s begins...
I have seen a two dimensional array[x][y] to be used in the code like this : array[i]
When it is used like this we mean that we only refer to the row and that the column is zero?
Thank you.
I have seen in different text/source code that a variable that will get the getchar() result is declared in some code listings as int and in other code listings as char.
Which is the proper...
You were right.I thought it should be declared as an int because it is used as a counter.
Thank you for your help.
I am trying to reverse a message using pointers but I get only the last character of the message.
Here's the code :
#include <stdio.h>
#include <stdbool.h>
#include <stdlib.h>
int main...
(*pairs)++ worked!
Thanks a lot guys for your time and your clear explanations!
It doesn't seem to work.
Here's the complete code list :
//Classifies a poker hand
#include <stdio.h>
#include <stdlib.h>
#include <stdbool.h>
I am calling a function that contains an int pointer as an argument :
function (int *p)
How can I increase the pointer value by 1?
*p++ is not working;
Thank you.
Thank you msh.Your code worked!
Many thanks!!!
How can I get a y or n answer from the user without messing with newline character.
The following code fails in this because the second getchar gets the newline character from the previous answer:
...
Thnx a lot for your help.I am trying now to solve the problem with the newline character and the getchar() command.
I wrote a solution for the game of craps.
Here is how it is played :
Each round has two phases: "come-out" and "point". To start a round, the shooter makes one or more "come-out" rolls. A...
Ok I solved the problem using this code : (I can't see the array elements in debugging mode but it works)
#include <stdio.h>
#include <stdbool.h>
int main (int argc, const char * argv[])...
http://i51.tinypic.com/2ekko5g.png
I am using gnu99 compiler.I am reading a book and it says that in c99 it is ok to use variable length arrays.
Well here's the code :
#include <stdio.h>
#include <stdbool.h>
int main (int argc, const char * argv[]) {
// insert code here...
int size;
I am trying to debug putchar with xcode but I can't see the characters in the console window?
Any ideas on this one?
This is my latest version (not perfect yet) :
#include <stdio.h>
#include <stdbool.h>
#include <stdlib.h>
#include <time.h>
int main (int argc, const char * argv[]) {
This is a solution but it does not work at all times and I can't find a logical flow in the code.
Any ideas?
#include <stdio.h>
#include <stdbool.h>
#include <stdlib.h>
#include <time.h>
I made the classic mistake of == instead of =.
Sorry!!
:(