General C++ Programming - October 2009 (Page 2)

Hex bytes to integer
 
I have a byte array and I need to convert the first two bytes to an integer as though they're one byte, but they have to be read backwards. ie. The first byt...
[3 replies] Last: Thanks helios, you too jsmith. (by Jo3Bingham)
Postfix to Infix
 
Hi. What I want to do is convert a postfix expression into a infix expression. I am reading the postfix expression from an input file and I want to print the in...
[no replies]
by JWP321
Invalid use of class error
 
Hi, when i compile the code for proj07.driver.cpp, I recieve the following error: proj07.driver.cpp:10: error: invalid use of 'class String' I'm not sure ...
[6 replies] Last: friend std::ostream& operator<<( std::ostream&, const String& ); ... (by jsmith)
by nikman
exception handling
 
I have the following code within which I'm trying to implement exception handling. But it goes into an infinite loop. Could someone tell me what I'm doing wrong...
[5 replies] Last: You must be calling the function in a loop? (by jsmith)
by minix
Static Code Analysis
 
Hi everybody, Have anybody use Frama-c (static code analysis)? Thanks, Andy
[no replies]
by nikman
Vectors and pointers
 
The following code crashes when it reaches the diner ->setOwner Any idea why? diner is declared as vector<Restaurant*> diner int loadInfoRes(string ...
[9 replies] Last: Got it. Thanks heaps mate :) (by nikman)
Nested linklist
 
struct IPInfo { string IP; string ipUser; IPInfo *next; }; struct AP { IPInfo objIPInfo; int user; int distance; A...
[no replies]
compiler error
 
hi, these are my errors and i really don't know what to do to fix them. i'm guessing its some inclusion errors but i'm really just kind of lost. i have 4 .cp...
[2 replies] Last: Please post your code for "proj.cpp" and I will try to help. (by mbittel12)
by JRevor
Getting >> to read up to \n in text files
 
I have this simple text file A E I O U A B C D E Im doing something like this with my code file >> line; I want to receive A E I O U ...
[2 replies] Last: yep chrisname.. that was what i was searching ^_^. I realized the a... (by JRevor)
How do I add arrays into my program!?!?
 
Trying to make this setup for my arrays: Print Output Format: Print total resistance followed by the values of each resistor. For series: (Example) Total ...
[3 replies] Last: can anyone assist me with this? please? on why the resistor values are... (by sl02ggp)
linker problems
 
hey,im having linker error issues with this program im writing example: [Linker error] undefined reference to `llist<int>::llist()' header: #ifndef LL...
[13 replies] Last: Just out of interest - what was the problem? (by guestgulkan)
File operations, is there a cross platform way to do it?
 
Specifically, reading the contents of a folder (folders and files). I'm currently creating a small game in C++ with SDL and experimenting with file-based, user ...
[3 replies] Last: Well, it seems the specific binaries I needed to link to to get a spec... (by helios)
Program to execute another Program with Command line arguments
 
I want to call a program with command line arguments (eg p1.exe arg1 arg2) from a C++ program. Does anyone know how? Thanks.
[5 replies] Last: Yes, thats how I finally solved it (I used sprintf though). Thanks! (by n4nature)
Problems with STL list, lists for a class
 
Greetings!! I'm trying to write and access a list of persons where This code tries to write one person and print it again. The problems is that I can ...
[6 replies] Last: Thank you so much for reply me amigo. I've improved my code now. ha... (by juanwalker)
Smallest executable
 
I need an extremely optimized compiler that gives a very small output file. I'm limited extremely on space where I'm working on my projects currently. A simple ...
[12 replies] Last: LOL @ ^ And VC++ isn't flexible. That's not nonsense, that's the tr... (by closed account S6k9GNh0)
by ragrax
fstream and multiple *source code* files
 
I am writing a program with multiple source code files (my IDE is code blocks). I have a readBytes() function which opens an ifstream from a binary file and re...
[1 reply] : wow I feel dumb - after sweating this problem for a couple days, I pos... (by ragrax)
escape sequences
 
We all know about things like /n, /b, /a, /0, and /v. There are others. But... as far as I know, there's a way to put ANYTHING as an escape sequence using it's ...
[3 replies] Last: Thanks. I needed jsmith's answer. I should've been more specific. You ... (by praeceps)
A simple program !
 
A simple program in C that print the number of letters of each word contained in 1 array: ex. " i love London" prints: ...
[1 reply] : Do your own homework... (by closed account S6k9GNh0)
qn on exception throwing
 
Are these 2 equivalent? throw runtime_error( "error" ); and runtime_error error( "error" ); ... throw error;
[1 reply] : They would be if there was no ... (by kbw)
data base program
 
if (strcmp(Type,"Car")==0) { OCar.SetTyre(Tyre); OCar.SetPaint(Paint); OCar.SetDoor(Door...
[1 reply] : Yes you can. That's what inheritance is all about, reusing facilities... (by kbw)
October 2009 Pages: 1234... 17
  Archived months: [sep2009] [nov2009]

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