Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. General Programming
  3. Managed C++/CLI
  4. help with arrays [modified]

help with arrays [modified]

Scheduled Pinned Locked Moved Managed C++/CLI
regexhelptutorial
2 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • K Offline
    K Offline
    klutez123
    wrote on last edited by
    #1

    sorry in advanced if i posted in wrong forum I am looking for help how to output a chart into the arrays, all i was given was that i need to put a loop inside of a loop. The chart given is: 0 0 0 0 0 1 2 3 0 2 4 6 0 3 6 9 This is what I have so far: // Compiler Directives #include "stdafx.h" #include "pattern.h" #include #include #include #include #include // Global Declarations using namespace std; CWinApp TheApp; /***************************************************** * MAIN * *****************************************************/ int main() { int j; int i; int test_score[4][4]; for(i = 0; i < 4; i++) { for(j= 0; j < 4; j++) { test_score[i][j] = 0; cout<< test_score[i][j]; } cout< -- modified at 9:17 Wednesday 18th April, 2007

    P 1 Reply Last reply
    0
    • K klutez123

      sorry in advanced if i posted in wrong forum I am looking for help how to output a chart into the arrays, all i was given was that i need to put a loop inside of a loop. The chart given is: 0 0 0 0 0 1 2 3 0 2 4 6 0 3 6 9 This is what I have so far: // Compiler Directives #include "stdafx.h" #include "pattern.h" #include #include #include #include #include // Global Declarations using namespace std; CWinApp TheApp; /***************************************************** * MAIN * *****************************************************/ int main() { int j; int i; int test_score[4][4]; for(i = 0; i < 4; i++) { for(j= 0; j < 4; j++) { test_score[i][j] = 0; cout<< test_score[i][j]; } cout< -- modified at 9:17 Wednesday 18th April, 2007

      P Offline
      P Offline
      PhillArx
      wrote on last edited by
      #2

      Hello re : nested loops Your loop should look like this: for(int i = 0 ; i< 4; i++) { for(int j = 0 ; j< 4; j++) {cout << j*i << " " ; } cout<< endl; } multiplying the outer loop i with the inner j seems to get the result; hope this might help Phill

      1 Reply Last reply
      0
      Reply
      • Reply as topic
      Log in to reply
      • Oldest to Newest
      • Newest to Oldest
      • Most Votes


      • Login

      • Don't have an account? Register

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • World
      • Users
      • Groups