User Profile

Collapse

Profile Sidebar

Collapse
newguy194
newguy194
Last Activity: Oct 22 '07, 01:31 PM
Joined: May 15 '07
Location:
  •  
  • Time
  • Show
  • Source
Clear All
new posts

  • newguy194
    replied to Reading file
    in C
    I have solved the problems I was encountering by reformatting the file I am using and implementing vectors here:
    Code:
    #include <cstdlib>
    #include <iostream>
    #include <fstream>
    #include <conio.h>
    #include <vector>
    using namespace std;
     
    int main(int argc, char *argv[])
    {
        vector<string> contents;
        string input;
        string output;
    ...
    See more | Go to post

    Leave a comment:


  • newguy194
    replied to Reading file
    in C
    Thanks for noticing that problem john, but I am currently testing it with a file where that is exactly the case, so I do not believe that is my main error. Although I was wondering whether simply using
    Code:
      while(!file.eof())
        {
        getline(file, search);
        contents+=search;
        }
    would remedy the problem you noticed....
    See more | Go to post

    Leave a comment:


  • newguy194
    started a topic Reading file
    in C

    Reading file

    I have written the skeleton for a program which is supposed to dissect a text file by first getting the entire contents of the textfile as a string, then searching that string for a matching first word, then skipping over a delimiter and returning the correct word. For some reason it does not return anything, and I do not see where my error is occuring.

    Code:
    #include <cstdlib>
    #include <iostream>
    #include <fstream>
    ...
    See more | Go to post

  • newguy194
    replied to Classes' Classes
    in C
    How would I declare that something should be a new vegetable and not a new fruit, and vice versa....
    See more | Go to post

    Leave a comment:


  • newguy194
    replied to Classes' Classes
    in C
    I'm not sure if I was really clear in my above question, so I wrote some code that maybe illustrates better what I am asking

    Code:
    #include <cstdlib>
    #include <iostream>
    
    using namespace std;
    class Food
    {
          private:
          class vegetable
          {
                private:
                string vegname;
                int calories;
                public:
    ...
    See more | Go to post

    Leave a comment:


  • newguy194
    replied to Classes' Classes
    in C
    Multiple inners

    I have one more problem, how can I have multiple private classes inside my outer class? like Inner1 and Inner2, I do not fully understand how this works.
    See more | Go to post

    Leave a comment:


  • newguy194
    replied to Classes' Classes
    in C
    I understand the declarations, but I'm confused as to how to implement it in my code, say I want to reference a member of mysecondClass how would I do that?...
    See more | Go to post

    Leave a comment:


  • newguy194
    started a topic Classes' Classes
    in C

    Classes' Classes

    I am writing a program to familiarize myself better with certain aspects of classes, and was wondering how to properly implement a class inside a class, and make it so only a certain instance of the original class can call a certain instance of the nested class. Basically I'm trying to get an object to have an object on it, and to make the second object exclusive to the first object. I'm confused about how to go about this.
    See more | Go to post

  • newguy194
    replied to Win32 Buffer Overflow
    in C
    Thanks for the help, I'm 'trying' to teach myself win32 from online tutorials and some old books belonging to my brother, the books are dated from 1999 through 2002, so I might need a newer one.
    See more | Go to post

    Leave a comment:


  • newguy194
    started a topic Win32 and Java
    in Java

    Win32 and Java

    Can Win32 be implemented using the JVM?
    See more | Go to post

  • newguy194
    started a topic Win32 Buffer Overflow
    in C

    Win32 Buffer Overflow

    I am writing a GUI for a program which scrambles text messages, but I believe I am running into buffer overflows somewhere and have tried various ways of stopping the overflows from happening. When the user input text, it encrypts fine, but when the user decrypts text, they will get various strings appended to the end from memory, such as windir=C:\Windo ws, and other random strings.

    Code:
    #define IDB_BUTTON 101
    #define IDB_EDIT 102
    ...
    See more | Go to post

  • newguy194
    replied to Jump to Case label
    in C
    I would really appreciate help, I can't figure out the problem.
    See more | Go to post

    Leave a comment:


  • newguy194
    replied to Win32 Edit newline
    in C
    I have fixed this problem....
    See more | Go to post

    Leave a comment:


  • newguy194
    started a topic Jump to Case label
    in C

    Jump to Case label

    I am currently writing a Win32 application and when I compile I get a "Jump to case label" error and another error tellling me that switch(LOWORD(w Param)) is unreachable in the switch, when I remove the first case IDB_BUTTON it runs fine, but with it there are several compile errors.


    Code:
    LRESULT CALLBACK WndProcedure(HWND hWnd, UINT Msg,
    			   WPARAM wParam, LPARAM lParam)
    {
        switch(Msg)
    ...
    See more | Go to post

  • newguy194
    replied to Win32 Edit newline
    in C
    For some reason looping through the array to delete it doesn't seem to work, it will delete the first of two pipes, then terminate the loop....
    See more | Go to post

    Leave a comment:


  • newguy194
    started a topic Win32 Edit newline
    in C

    Win32 Edit newline

    I have a win32 app which get text from an edit box and stores it in a dynamic array, I was wondering how to make my program ignore the newlines from pressing enter and not show them a part of the dynamic array. The newlines appear as || in my array.
    See more | Go to post

  • newguy194
    replied to Win32 Button
    in C
    Sorry, my compiler is gcc, not Dev silly me.
    See more | Go to post

    Leave a comment:


  • newguy194
    replied to Win32 Button
    in C
    Something really, really, really, really weird. On the PC which I do most of my programming on the program fails to run correctly and nothing appears, but on my Vista pc the program runs fine, generates a button and doesn't fail any of the checks.
    See more | Go to post

    Leave a comment:


  • newguy194
    replied to Win32 Button
    in C
    My compiler is gcc

    The program creates a window for me, but does not generate or display the button, and the check I added for the button is telling me it is not created....
    See more | Go to post

    Leave a comment:


  • newguy194
    started a topic Win32 Button
    in C

    Win32 Button

    Why am I unable to produce a button with this Win32 program? All I have been able to produce is the empty window.



    Code:
    #include <windows.h>
    
    // Declare WndProcedure
    LRESULT CALLBACK WndProcedure(HWND hWnd, UINT uMsg,
    			   WPARAM wParam, LPARAM lParam);
    
    INT WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance,
                   LPSTR lpCmdLine, int nCmdShow)
    ...
    See more | Go to post
No activity results to display
Show More
Working...